Search This Blog

Thursday, November 15, 2012

CategoryInfo : NotSpecified: (:) [], PSSecurityException + FullyQualifiedErrorId : RuntimeException


When I try to execute my PowerShell script I get this error:
File C:\Common\Scripts\hello.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:13
+ .\hello.ps1 <<<<
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException


You should type the following to make it go to unrestricted mode:
Set-ExecutionPolicy unrestricted

Note:

The Default Execution Policy is set to restricted, you can see it by typing:
Get-ExecutionPolicy 











No comments: