The ‘InvokePowerShell’ activity will call a Microsoft Windows PowerShell file or command that is specified in the Command Text expression.
When pasting the command directly in CommandText, we must tick Is Script property for the command to work.
Most of the properties on this activity can be set using variable expressions which must be enclosed inside double quotation marks “”.
- Command Text The command text, or the Microsoft Windows PowerShell file to be executed. When using the command directly in the Command Text, we must tick Is Script property for the command to work.
- Command Text See Designer Properties above.
- Input Represents the pipeline input for the powershell script. The input is represented as an IEnumerable(object).
- Is Script Sets the method of how the script is executed. Checked when using a PowerShell command script directly in Command Text; Unchecked when using a PowerShell file in Command Text.
- Parameters The parameters to be sent to the power shell script. Represented as a Dictionary(string, object), where key is the name of the parameter and value is its value.
- Power Shell variables The predefined powershell variables.Represented as a Dictionary(string, object), where is key is the name of the variable and value is its value.
See General Properties.
- Errors The output errors reported by the PowerShell script as a Collection of ErrorRecord. For more information about ErrorRecord please https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.errorrecord?view=powershellsdk-7.0.0
- Output Error See Out Error.
- String Errors All the PowerShell errors concatenated by new line in a string.
- Output The result of the execution as a Collection of PSObject. For more information on PSObject, please check https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.psobject?view=powershellsdk-7.0.0
- String Result The result of the execution converted to string and separated by new Line.
In this example, the activity will copy all the ‘rpack’ files from ‘SampleProjects to ‘ProjectsOutput’ using the Microsoft Powershell command "copy-item SampleProjects\*.rpack ProjectsOutput -force -recurse -verbose"
SampleProjects and ProjectsOutput are relative directories to Rinkt Studio.