I am getting issues running powershell - scripts are disabled etc - what should the execution policy be? Surely UIPath has a how to set up the execution policy for windows 10/2019 etc ?
I heavily use powershell to automate stuff in my day to day job and the ability to use it when i cant get what i need from the UIpath UI (Yes i am learning C# too), but this is holding me back
I can use the start process, but that flashes up a blue screen every time its invoked - can someone please advise?
Thanks again for your help on this !
Phil
PS i am GMT so i may not pick up any replies/responses until Sunday (Tomorrow morning GMT) , just so that you know i am not being ignorant !
Just to add something. If you are using Studio Windows projects, then the Invoke PowerShell will use the PowerShell 7.1 available in the PowerShell SDK that comes with the System package and not your machine installation of PS.
This means that your normal execution policies will not affect the actual process.
You can easily fix that by adapting the policy at the start of your script, i.e. like so:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
Thankyou for this excellent tip.
Unfortunately I need to run a module called PnP.PowerShell in this 7.1 bundled powershell - how do I do that? I have PS5.x on my machine and the module is installed there. When I run the automation that uses an Invoke-PowerShell -activity, it does not find the PnP.PowerShell module at all.
How do i tell UiPath Studio and Robot where to find the module, if its in a “bundled” version of PS and not the machine’s actual PS?
This problem occured once i patched studio to version 2023.4, before that it worked perfectly.
When I am running the PowerShell script on local machine manually. It is running successfully but when I am trying to run the PowerShell from UiPath. It’s gives the access error. Screenshot is attached