Powershell Script

It allows you to automate tasks like integrated scheduling, logging and capturing results with success or failure notifications using Powershell scripts or commands.

Using Powershell Script Activity

  1. In the Canvas Tools pane, click Process Components to expand the tool and view the associated activities.
  2. Drag the Powershell Script  activity and drop on to the Flowchart designer on the  Canvas. The instructions to use the activity depends on the execution type. The available options are:
    • Script- executes the Powershell scripts
    • Cmdlet- executes the Powershell commands

 

Script

  1. In the Command Type list, select Script to execute complex Poweshell scripts.

 

 

  1. The Cmdlet/Script field changes to Script. In the list, select the parameter that stores the file path (along with the file name) of the Powershell scripts, saved in your system. You must define the parameter in the Parameter bar to use this option.
  2. Click the (Settings) icon. The Scripts Input dialog box appears. This lets you call the function via arguments.

 

 

  1. Click Add. In the Input Type list, select the type of argument you want to pass. Available options are:
    • Arguments- calls the script using ordered list of values (that is by position and not name). The parameter name may not be the actual match as the parameters used in the Powershell script.
    • NamedParameter- calls the script using the full name of the parameter and not in any order. The parameter name must be an actual match as the parameters used in the Powershell script.
  2. In the Select Argument or Select Parameter (depends on the Input Type selected) list, select the intended parameter. You can add multiple rows and select arguments as per the script requirement.
  3. Click CONFIRM to save the configuration.
  4. Click Result Mapping link, the Output Path list appears. Select the available parameter to save the result of Powershell execution performed. You must define the parameter in the Parameter bar to make it available for selection in the list.

Cmdlet

  1. In the Command Type list, select Cmdlet to execute the Poweshell commands.

     

    1. The Cmdlet/Script field changes to Cmdlet. In the list, select the parameter containing the command you want to execute. You must define the parameter in the Parameter bar to use this option.
    2. Click Result Mapping link, the Output Path list appears. Select the available parameter to save the result of Powershell execution performed. You must define the parameter in the Parameter bar to make it available for selection in the list.
      The automation process workflow for the Powershell Script is created.

Powershell Script  Activity Properties

The properties of a Powershell Script Activity are listed in the following table and can be edited in the Properties grid on the right panel.

 

Property Name

Usage

Control Execution

Ignore Error

When this option is set to Yes, the application ignores any error while executing the activity.

If set to NA, it bypasses the exception (if any) to let the automation flow continue; however, it marks the automation status as failure, in case of an exception.

By default, this option is set to No.

Delay

Wait After

Specify the time delay that must occur after the activity is executed. The value must be in milliseconds.

Wait Before

Specify the time delay that must occur before the activity is executed. The value must be in milliseconds.

Misc

Breakpoint

Select this option to mark this activity as the pause point while debugging the process. At this point, the process freezes during execution allowing you to examine if the process is functioning as expected.

In large or complex processes, breakpoints help in identifying the error, if any.

Commented

Select this option to mark this activity as inactive in the entire process. When an activity is commented, it is ignored during the process execution.

DisplayName

The display name of the activity in the flowchart designer. By default, the name is set as Powershell Script. You can change the name as required.