Activities
- PS Script
- Powershell DSC
PS Script
This activity runs a powershell script.
...
- Command (text box editor type) (type: string):
- the PowerShell inline script. This parameter takes precedence over the Script Code parameter. Without $using, a $a workflow variable (variable defined via workflow, visible in the Variables area) is not visible in the script. $Using imports the variable and its current value (e.g. {$a = $using:a+1; $a})
- the Command editor has a syntax highlighting toggle, for displaying the lines according to the chosen language. In the example below, PowerShell was used:
the user can also use an external editor of his/her choice via the button to the left of the edit field (). The external editor is by default Windows notepad, but it can be changed in the Designer Settings.
- Include Administrator Scripts (combobox editor type) (type: string): this parameter specifies whether to include the execution of the scripts assigned to the task in Administrator. The task selected from Administrator will be executed first and added to the result of the powershell script.
- Parameters collection (collection editor type) (type: string): the parameters you want to send with the request. e.g. Name: -ArgumentList and Value:arg1.
- Password Name (text box editor type) (type: string): the name for the password variable used in the script. This is used in case of scripts that are using password variables, in order for a plain text password display to be avoided.
- Password (password box editor type) (type: string): the value for the password that will be used in the script (encrypted).
- Password Binding (text box editor type) (type: string): bind to a variable containing the encrypted password for the script.
- Script Code (text box editor type) (type: string): the Powershell script code to be executed. For example: "mkdir 'C:\FlowsterSolutions'" (this command creates a folder with the specified path).
- Script File (text box editor type) (type: string): the Powershell script file. This parameter takes precedence over the Command and the Script Code parameter.
- Script Parameters (text box editor type) (type: string): the parameters that will be passed to the PowerShell code stored in a PowerShell script file. For multiple parameters, separate the values with comma ( , ). This parameter will take effect only when a script file is selected for execution.
...
- Output (type: collection<PSObjects>): outputs a collection of "PSObjects" type objects..
- Output Rows (type: int32): outputs the number of "PSObjects" type objects returned by the execution of the script.
Powershell Demo sequence:
On Execution (Home->(Execution section) Start button) - task "Powershell_Demo" , Tracking Data panel should display:
Get-Service command situation
...
- Service Display Name
- Service Machine Name
- Service Status
The variables should be declared with the following types:
Powershell DSC
This activity rsends the compiled configuration files(.mof) to the MS Configuration Service for execution
Activity Parameters
The Powershell DSC activity parameters can be provided by manual inserted values or via IN arguments or variables:
Parameters:
Computer Name (text box editor type) (type: string): enter the machine name for the remote connection
- Configuration file (browse to filer type) (type: string): this parameter specifies a file path of a folder that contains configuration setting files. This cmdlet publishes and applies these configuration settings to computers that have setting files in the specified path. Each target node must have a setting file of the following format: NetBIOS Name.mof
- Remote Password (password box editor type) (type: string): the value for the password that will be used for the remote connection.
- Remote Password Binding (text box editor type) (type: string): bind to a variable containing the encrypted password for the remote connection.
- Remote Username (text box editor type) (type: string): Enter the user name for the remote connection. Remote username is not requiered, if no username is added the activity will use the login users credentials.
The Read Only Output variable are the possible output values that the activity will provide:
- Output (type: Boolean): outputs whether the operation succeded or not.