Failed to call powershell scripts

UiPath Studio Version: 19.7
Problem: Failed to call powershell scripts with the following exception:

Message: File C:\tdrive\test.ps1 cannot be loaded because the execution of scripts is disabled on this system … Exception Type: System.Management.Automation.PSSecurityException.

I run Uipath Studio with the administrator account and I can run the scripts from command line. When I run the command “get-ExecutionPolicy -Scope LocalMachine” it returns “unrestricted”. Seems everything is OK?

Could you please help on it?

Thanks.

image

hello @ww2ivy

instead CMD you can directly call powershell and execute the poweshell script .

image

in the above image powershellScript is the path where powershell script is store.

Regards
Ajay

Thanks a lot for the guide!

Hey @ww2ivy

Why you are not using Invoke Power Shell Acrivity? :slight_smile:

Regards…!!
Aksh