Use a custom PowerShell script as an Object

Automation Manager incorporates over 600 bundled objects. It also includes the option to incorporate your own PowerShell script through the Run PowerShell Script object.

To apply a custom PowerShell script when building a policy:

  1. Go to the objects pane
  2. Under Extensions choose Run PowerShell Script
  3. Drag and drop the Run PowerShell Script object onto the target area of the policy
  4. Choose the Scripts tab of the Run PowerShell Script object
  5. Click Edit
  6. Paste you PowerShell script contents
  7. OK to apply the script
  8. Configure the Input and Output Parameters (where required)

Input and Output Parameters

For the script engine to recognize the PowerShell script's Input and Output parameters in the Run PowerShell Script Object, the parameters must be preceded by $

Example

Parameter Name

Parameter Name as entered in the Run PowerShell Script Object

InputParameter

$InputParameter

OutputParameter

$OutputParameter

Exit codes returned by the PowerShell script are only consumed within the Run PowerShell Script module and not passed back to the Dashboard.

To generate a Dashboard failure where the PowerShell script fails, add an If or If/Else Control Flow condition and include the Fail Policy module.

For example, Run PowerShell Script (Extensions) > If (Control Flow) > ThenFail Policy (Control Flow).

am_powershell

 

What do you want to do?