Executes a PowerShell command.
Argument |
Type |
Description |
---|---|---|
CommandText |
String |
Command to execute. |
Arguments |
IEnumerable<string> |
(Optional) Arguments to the command. |
Input |
IEnumerable |
(Optional) The input pipeline. |
IsScript |
bool |
(Optional) Indicates whether This option is only available in the Properties pane and not in the Designer pane. |
Parameters |
Collection |
(Optional) Collection of name-value pairs passed as parameters to the PowerShell script. This option is only available in the Properties pane and not in the Designer pane. |
PowerShellVariables |
Collection |
(Optional) Variables copied into the PowerShell runtime. This option is only available in the Properties pane and not in the Designer pane. |
PSModules |
IEnumerable<string> |
(Optional) Modules loaded into the PowerShell runtime during command execution. This option is only available in the Properties pane and not in the Designer pane. |
Runspace |
Runspace |
(Optional) Creating a PowerShell runspace and supplying it to this argument enables you to reuse the same runspace in multiple PowerShell invocations, which may result in performance improvements. This option is only available in the Properties pane and not in the Designer pane. |
Argument |
Type |
Description |
---|---|---|
Output |
Collection<PSObject> |
Output of command if any. Throws exception on error. |
Errors |
Collection<ErrorRecord> |
Errors resulting from execution if any. |
If you receive the error message Type PSObject is not defined in the vRealize Automation Designer console when you are dealing with the output of ExecutePowerShellScript, perform the following steps:
Click Imports in the lower left corner of the Designer pane.
Select the System.Management.Automation assembly.