Hi,
I am trying to save the output of a batch file to a variable, this is what I do:
$output = & "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE\check_emc_hw.bat"
The problem is, that when I run the script in powershell on the probe, $output contains the output of the check_emc_hw.bat batch.
If I run the script within a PRTG sensor, the $output is empty.
If I try the following, $output is empty, as well.
& "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE\check_emc_hw.bat" | tee-Object -Variable output | Out-Null
Probe OS is Server 2008 R2, Powershell version is 2.0 and the probe version is V16.2.24.4666
Can anybody tell me, why Prtg won't save the output to $output?
Thanks,
Matthias
Add comment