I'm trying to find a working script to get active snapshots on vsphere 6.7. I've found this script linked to PAessler script portal:
The script is working running on Powershell inside the probe, but if I try to using it in Custom EXE/Script Sensor, I receive this error:
Response not well-formed: "(-1:Error occurred while checking for snapshots: System.Management.Automation.CommandNotFoundException The term 'Connect-VIServer' 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 System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) )" (code: PE132)
thanks for the help!
I've solved removing the module and imported again!
Finally I currently use this script found on git hub: https://github.com/saxos1983/prtg/blob/master/CheckForVMwareSnapshots.ps1