Create a custom PowerShell activity return data to a workflow from a host using Microsoft PowerShell.

Before you begin

Role required: activity_creator or workflow_admin

About this task

ServiceNow supports PowerShell 3.0 to 5.1.

Procedure

  1. Create a custom activity.
    This action creates a custom activity using a template.
  2. After setting up general properties and creating input variables, configure the PowerShell Execution Command.
    Note: You can map parameter values in a test payload to variables in the Outputs tab automatically. See automap output variables.

What to do next

Finish creating your PowerShell activity by creating output variables, creating a parsing rule, or Conditions. Refer to the create custom activities topic to know your template options.

PowerShell template execution parameters

You use execution parameters to create the input process script in the Pre Processing form of the activity designer.

For descriptions of the Powershell command fields, see the table in Configure the PowerShell execution command.
Note: You must use the executionParam. prefix with all variables in this table.

Powershell post-processing parameters and payload parsing

Use these parameters to create a post-processing script, payload parsing, and tagging.