Jaroslav Faldik (Customer) asked a question.

Testing PowerShell script as an Actions

How should a PowerShell script used as an Action end correctly so that it passes the Action test successfully and is subsequently logged as a "success"?

 

I use a PowerShell script to send SMS messages (SMS over VoLTE) via an SMS gateway. This works for me, but I have a problem with the script code validation in WUG. When the script ends in Windows PowerShell ISE with the expected response from the SMS gateway after executing the command, the WUG test fails with the error "Error executing script: No result text". Conversely, if the script runs in Windows PowerShell ISE but ends with the message "You cannot call a method on a null-valued expression," the test in WUG completes successfully with:

"Result:

 

<?xml version="1.0" encoding="utf-8"?> <Root> <QueueAddResponse> <Rslt>1</Rslt> <ID>97</ID> </QueueAddResponse> </Root>", which is the expected valid response from the SMS gateway.

 

Does WUG expect a specific text format when testing the script?

 

Translated with DeepL.com (free version)