I have found strange behaviour regarding execution of powershell as UserParameter in windows Zabbix agent.
When I am using this
It works as expected, zabbix_get returns textual output of the powershell command, the same value as if I started powershell from windows CMD
But this
just return nothing, only empty line.
But the powershell commnad invoked from windows CMD shows me expected value - list of my certificates.
Please any ideas what I am doing wrong? The commands are nearly identical, only tryinf different powershell cmdlet
When I am using this
UserParameter=certcheck,powershell -nologo -Noprofile -ExecutionPolicy Bypass -command "Get-ScheduledTask -TaskName CacheTask"
But this
UserParameter=certcheck,powershell -nologo -Noprofile -ExecutionPolicy Bypass -command "Get-ChildItem -Path Cert:CurrentUser\My"
But the powershell commnad invoked from windows CMD shows me expected value - list of my certificates.
Please any ideas what I am doing wrong? The commands are nearly identical, only tryinf different powershell cmdlet