Run PowerShell Script

Runs a PowerShell script.

Do not use $Result and $ResultString variables!

Do not use $Result and $ResultString variables in the embedded PowerShell script. These variables are reserved for internal use only and may cause the object to not execute properly.

Script Size Limitation!

You will not be able to run a policy in Automation Manager that contains a PowerShell script larger than 10MB.

Password Security

Be aware that password parameters are not safe when passed to this object as they are treated as regular System.String values.

Privileges

Normal

Input Parameters

Name Type Required Description
Script String Yes The contents of the PowerShell script.
Input Parameter List User Configurable No

Input parameters are created by the user.

If a password contains a single quote (apostrophe), the single quote must be replaced by two single quotes when entering the password into a password field. For example, if the password is ab'cd, enter ab''cd (where '' is two single quotes and not a double quote) into the password field.

If the input parameter is a Number type, and the value is the maximum allowable (1E+308), it will not be valid when run in N-able N-central.

Output Parameters

Name Type Required Description
Output Parameter List Configurable No Output parameters are created by the user.
Result Number   Returns a success value of zero or any value other than zero to indicate failure.

Example Input Parameters

Name Type Required Example
Input Parameters User Configurable No

Optionally create input parameters to be used within the Script.

If a password contains a single quote (apostrophe), the single quote must be replaced by two single quotes when entering the password into a password field. For example, if the password is ab'cd, enter ab''cd (where '' is two single quotes and not a double quote) into the password field.

Script String Yes Paste PowerShell script contents.
Output Parameters User Configurable No

Optionally create output parameters to be used within the Script.

Any value other than 0 will cause a policy run with the Run PowerShell Script object to fail.

Run as Current Logged on User Boolean No Optionally run the script as the current logged on user.