Hello
I created a custom PowerShell script to use with the Custom EXE/Script type of sensor, but I am not able to get results from it because it says it cannot find the "Get-VM" module. I have installed WMF 5.0 in the Windows Server 2012 R2 running the PRTG probe, AND installed Hyper-V Powershell management tools. When I run the script directly from the PRTG probe in a PowerShell ISE window, the script does what it needs. It uses the Get-VM module.
But when the PRTG sensor tries to use the script, the logs notes this:
Get-VM : The term 'Get-VM' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\checkAllDCsTimeSyncSvcs.ps1:5 char:22 + $domaincontrollers = Get-VM -ComputerName $hypervhost | where {$_.Nam ... + ~~~~~~ + CategoryInfo : ObjectNotFound: (Get-VM:String) [], CommandNotFo undException + FullyQualifiedErrorId : CommandNotFoundException
This doesn't make sense to me, because I have all the necessary tools. Is there a way in PRTG to make it see the latest WMF / PowerShell version ?
Thank you!
Add comment