InvokePowerShell

Estimated reading: 3 minutes 2108 views

This activity helps the user to run the “PowerShell” command-let(cmdlet) or PowerShell scrips within the workflows. It  is particularly useful for automating Windows-specific tasks, as PowerShell is a powerful scripting language on Windows platforms.

Properties

INPUT

Command:* Indicates to provide the “Command-Let” or PowerShell command to run the activity. This parameter accepts values in “String” datatype. You can provide the Command-Let directly here or can enter the script either as the values hardcoded in “String” format or pass the values as “String” datatype

InputString: Indicates to provide the collection of input values that are passed to the command script which is required during the execution of the script. You have the option to hardcode the values in the collection of “IEnumerable” format.
By default, the option will be blank. When left empty, it will not be considered. 

IsScript: Indicates to check this option when the input provided in the “CommandText” box is a script or a direct commandBy default, the option will be blank. When left empty, it will not be considered. 

Parameters: This parameter helps you to provide the “inputs” that are required to pass during the execution of the “PowerShell script”. By default, the option will be blank. When left empty, it will not be considered. This field accepts collection of argument types. 

PowerShellVariables: This parameter indicates the variables that are used internally in the PowerShell Command script denoted by “$” symbol before the variable. By default, the option will be blank. When left empty, it will not be considered. This field accepts collection of argument types.   

MISC

Display Name: Displays the name of the activity. The activity name can be customized, which aids in troubleshooting.

SkipOnError: Specify the “Boolean” value as “True” or “False.”
True: Continue executing the workflow regardless of any errors thrown.
False: Halt the workflow if it encounters any errors.
None: If the option is left blank, the activity will, by default, behave as if “False” were chosen.

Version: It indicates the version of the feature being used.

OUTPUT

Errors: This parameter helps to return the errors captured while executing the command script in the activity. You need to mention the “SkipOnError” as “True” to print the errors as output. It returns the values as “String” datatype.

Output: This parameter helps to return the output executed from the script in a collection of values. It returns the values in “Collection<PSObjects>” datatype.(Refer the below documentation).  

*Represents Mandatory field to execute the workflow

Share this Doc

InvokePowerShell

Or copy link

CONTENTS