Writing Scripts for Script Delegator

Script Delegator supports running any PowerShell script without modification, however the user will get an “Unknown” Last Status response unless PowerShell generated a warning or error message.

Script Delegator Response Object

To control the Last Status response and provide more information to Script Delegator, you can return the following Script Delegator Response Object as part of your PowerShell script logic:

  • TreatAsScriptDelegatorResult – Set to $true, this tells Script Delegator that the response should be treated as a Script Delegator Response Object
  • Message – User friendly message
  • MessageVerbose – Provides a way to include a more verbose message suitable for admin troubleshooting
  • ResponseCode – The result of running the script, which supports Success/Warning/Failure

In addition to the information you return with the Script Delegator Response Object, warning and error messages generated by PowerShell will be stored in the logs.

Full Example

 

 

 

in User Guides

0