Follow this step-by-step process:
- Create a .TXT file containing the desired PowerShell script.
For example, PS_Sample.txt
- In UiPath, use “Read Text File” activity and use the text file in the file name field
![](https://www.edureka.co/community/?qa=blob&qa_blobid=4588043275498925183)
- Set the output variable using a string variable as shown-
![](https://www.edureka.co/community/?qa=blob&qa_blobid=3319695855932749844)
- Add an “Invoke Power Shell” activity and set the values as shown below-
![](https://www.edureka.co/community/?qa=blob&qa_blobid=4663878020177336971)
- Under the properties of “Invoke Power Shell” activity, use the Parameters field to add your arguments.
Hope this helps,
Happy Learning!