I have stumped Support with this one.
I want to create an EXE Custom Sensor to run a WMI command against a remote server that returns back the number of patches applied in the last X number of days. I have set the Parameters to %host, see it as $args in my powershell script but cannot use it in -computername field for it to return any value. This works fine from command line and passing in the argument. From PRTG, it only returns the value of $srv.
$srv = $($args) $ans = gwmi win32_quickfixengineering -cn $srv $output = "$srv $ans" $output | out-file "c:\windows\temp\PRTG.out" -append