PowerShell

Document ID : KB000089604
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
PowerShell
Resolution:
Detailed Description and Symptoms

After executing a PowerShell script on a windows executor you got following error:
File C:\Path\Powershell.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.


?

Solution

Open regedit and change the following keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell
"ExecutionPolicy"="RemoteSigned"
"Path"="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"

 
Change also the ECPEXE value in the ini file of the agent to the path in the regedit key.
ECPEXE=C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
ECPEXT=ps1
?