Skip to main content

Execute Powershell Script

Description

Execute PowerShell Script runs a PowerShell script within a workflow to perform system administration tasks, interact with Windows services, or execute custom logic. Use this step when your automation needs access to PowerShell's capabilities — for example, managing Active Directory, querying WMI, or processing system data. The script can generate output fields using a specific console syntax, making results available as data for subsequent workflow steps.

Configurations

Field NameDescription
Step nameName of the step as it appears in the workflow workspace. This name has to be unique in a single workflow.
Fail if error?Enforces strict error checking.
If checked, the step fails immediately when any error occurs.
If unchecked, the step fails only if an error occurs and no standard output is produced.
For example,
Suppose the step extracts data from a file.
If checked, even a small error (such as a missing column) causes the step to fail.
If unchecked, the step fails only if an error occurs and no data is extracted. If some data is extracted despite the error, the step continues.
Left Pannel
Get Input FieldsClick and select the input fields from the list to add in console.
Write to Console:
Write Value to ConsoleClick to write output values to console in given syntax.
Syntax to write value:
Write-Host "<<>>FieldName::FieldValue<<>>"
Right Pannel
Powershell Script TabA console to write value or use input fields in Powershell Script.
Tabular FieldsThe Fields table displays a list of output fields extracted from script. It also allows users to add metadata such as descriptive names for each field.
Field NameDisplays name of the fields extracted from the script.
for example, from Write-Host "<<>>FieldName::FieldValue<<>>"
Rename toOptional new name for the field.
Used when you want to display or reference the field using a different name.
TypeSelect the data type of the field.
Following are the type and available supported formats:
Supported types are:
- String
- Date: Supported formats:
- yyyy-MM-dd
- dd/MM/yyyy
- MM/dd/yyyy
- dd-MMM-yyyy
- yyyyMMdd
- dd-MM-yyyy
- yyyy/MM/dd
- dd.MM.yyyy
- MMM dd, yyyy
- dd MMM yyyy
- Boolean
- Integer
- BigNumber
- Binary
- Timestamp: Supported formats:
- yyyy-MM-dd HH:mm:ss
- yyyy-MM-dd’T’HH:mm:ss
- yyyy-MM-dd’T’HH:mm:ss.SSSX
- MM/dd/yyyy HH:mm:ss
- dd-MMM-yyyy HH:mm:ss
- Internet Address
LengthSpecifies the length of the field:
- Number: Total number of significant digits
- String: Maximum number of characters
- Date: Length of the printed date output
PrecisionSpecify the number of digits to display after the decimal point. This applies only to numeric types.
- Number: Defines floating-point precision.
- Other types: This setting is not used.
Replace value ‘Fieldname’ or ‘Rename to’Select Y (Yes) to find an existing field in the input stream that matches Fieldname and replaces its value.
Select N (No) to add a new field to the output stream.
Action Button
Get Output FieldsClick Get Output Fields to see all output field details in table.
When the Get Output Fields is clicked, the tool scans the entire script and looks for statements in the following format:
Write-Host "<<>>FieldName::FieldValue<<>>"
It parses these statements, extracts the FieldName, and populates the Fields table accordingly.