Windows check with powershell - external commands


I created a check with powershell and also tested it locally.
Invoke-test -Warning 70 -Critical 90

I have generated the conf file with this manual

Get-IcingaCheckCommandConfig -CheckName Invoke-test -IcingaConfig -OutDirectory ‘C:\test’ -FileName ‘Icingatest’;

The conf file I have placed there:

I don’t see my command in external commands?

What do I have to do so that the command can be seen there?

Now I have copied the conf in this folder:

then I have to that:
icinga2 daemon -C

and get this message:
[2021-03-09 10:34:05 +0100] warning/ConfigCompiler: Cannot compile file ‘/etc/icinga2/zones.d/windows-commands/test.conf’: Error: Function call ‘std::ifstream::open’ for file ‘/etc/icinga2/zones.d/windows-commands/test.conf’ failed with error code 13, ‘Permission denied’

    (0) Compiling configuration file '/etc/icinga2/zones.d/windows-commands/test.conf'

I have found the solution. The problem was, that I create the conf file as root. I have change the rights to the icinga user. Than I start
icinga2 daemon -C
systemctl reload icinga2
and now it works.