sensu-plugins / sensu-plugins-windows

Sensu Windows Plugins
http://sensu-plugins.io
MIT License
22 stars 46 forks source link

unable to run window process check for multiple processes #112

Open dbadyan opened 4 years ago

dbadyan commented 4 years ago

Hi, the following line returns an error when running the script with multiple values. (such as 'cmd','explorer') https://github.com/sensu-plugins/sensu-plugins-windows/blob/17122e8d0bbdc2dee708279a57beaf9c91016973/bin/check-windows-process.ps1#L30

C:\Users\Administrator\Desktop\check-windows-process.ps1 : Cannot process argument transformation on parameter 'ProcessName'. Cannot convert value to type System.String. At line:1 char:58

when the [string] is removed the check works, but it's there to convert the value to a string so just removing it is not really the best solution...

derekgroh commented 4 years ago

@dbadyan Looking through the history, this check never supported multiple values. Have you had this work prior with multiple values before the last commit or is this a feature request?

dbadyan commented 4 years ago

No, this never worked before, but running the core command (get-process) with multiple values is valid so i expected the check to support it too. I suppose if this wasn't the original intention then it is indeed a request.