# Invoke Powershell Command

**URL:** <https://forum.uipath.com/t/invoke-powershell-command/130796>\
**Category:** Help\
**Tags:** studio, system, activities\
**Created:** [July 4, 2019, 8:09am UTC](https://forum.uipath.com/t/invoke-powershell-command/130796 "2019-07-04T08:09:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhi006](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@abhi006](https://forum.uipath.com/u/abhi006)\
**Post date:** [July 4, 2019, 8:09am UTC](https://forum.uipath.com/t/invoke-powershell-command/130796/1 "2019-07-04T08:09:08Z")

</div>

Hello Peeps | I want to copy a PowerShell command file from a network drive and run the file on remote desktop. Please help on how I might be able to achieve the same.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Pablito](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pablito/32/385495_2.png) [@Pablito](https://forum.uipath.com/u/Pablito)\
**Post date:** [July 4, 2019, 8:37am UTC](https://forum.uipath.com/t/invoke-powershell-command/130796/2 "2019-07-04T08:37:57Z")

</div>

Hi @abhi006,  
Welcome to the Community!  
Here is a nice tutorial written by our Forum member. Please have a look:

> [@How to Integrate PowerShell with UiPath- Step by Step guide](https://forum.uipath.com/t/how-to-integrate-powershell-with-uipath-step-by-step-guide/112279):
>
> How to Integrate PowerShell with UiPath This topic is a step by step guide for integrating Powershell with Uipath. There is an ‘Invoke Powershell Activity’ available in Uipath which can be used to run the powershell scripts. For our example purpose, let us consider a simple powershell script which gives us the status of windows services on the machine. This script will have two input parameters: • ServiceState (String) – To get the status of service. For e.g. ‘Running’ , ‘Stopped’ etc • Outp…

---

<div class="post-metadata">

**Author:** ![abhi006](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@abhi006](https://forum.uipath.com/u/abhi006)\
**Post date:** [July 8, 2019, 4:22am UTC](https://forum.uipath.com/t/invoke-powershell-command/130796/3 "2019-07-08T04:22:05Z")

</div>

Hello Pablito | I have tried the below activity and also Uipath.Script.Activities also . In both the cases the powershell is executed on the machine where the automation is running. I want the powershell command to be executed on the remote desktop we are connected to.

---

<div class="post-metadata">

**Author:** ![Pablito](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pablito/32/385495_2.png) [@Pablito](https://forum.uipath.com/u/Pablito)\
**Post date:** [July 8, 2019, 7:04am UTC](https://forum.uipath.com/t/invoke-powershell-command/130796/4 "2019-07-08T07:04:50Z")

</div>

Then your PS script need to be properly made. I’m not sure how you are operating with powershell but it need to have proper commands to connect to remote machine like:

> Enter-PSSession

Additionally PS Scripting and Remote Scripting need to be allowed on remote machine.
