PowerShell
The PowerShell action allows you to access PowerShell from within Nintex RPA LE.
By default, because Nintex RPA LE uses 32-bit architecture, it will access the 32-bit version of PowerShell. If you need to access the 64-bit version of PowerShell, use the Sysnative redirection folder path to run the PowerShell action.
Note: For more information about the timing and error settings, go to Action Builder.
-
Click Advanced in the Actions panel.
-
Click PowerShell in the Advanced list to display the Action Builder.
-
From the Script drop-down menu, select if you want to run the PowerShell script Embedded in your botflows or referenced as an External file.
-
(Optional) Add Notes to the action to document any special instructions or functionality.
-
Move the Run Switch to Run to execute the action after you click OK.
-
Click OK to save the action.
Note: The run switch is set to Run by default. To create or modify this action without executing it, click the slider to change the option to Don't Run. For more information, go to Action Builder.
The PowerShell script can call the RPAEngine.SetVar function to set the value of a variable in the botflow. This example sets the value of the FirstName variable to "John."
RPAEngine.SetVar -Variable "FirstName" -Value "John" |
The RPAEngine.SetVarfunction can be used more than once to set multiple variable values. This example sets the value of both the FirstName and LastName variables in a botflow:
RPAEngine.SetVar -Variable "FirstName" -Value "John" RPAEngine.SetVar -Variable "LastName" -Value "Doe" |
Note: The RPAEngine.SetVar function is a custom PowerShell function automatically added to your PowerShell code allowing you to call it from within your PowerShell script. All variable values are set after the PowerShell code has finished running.