Powershell error?

Posted by: robwilc

Tagged in: Untagged 

robwilc

Did you ever setup a new machine, and run your first glorious powershell creation to get a message like this :-

File 1234.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: 2

The reason for this is that the systems current execution policy prevents running of the script.  There are four levels :

Restricted: Commandlets can run, but not scripts.  This is the default.

Allsigned: Scripts can run but have to be digitally signed.  You'll also get prompts when running scripts from trusted publishers.

Remotesigned: Scripts running on the local computer don't need a signature, but any downloaded scripts do.

Unrestricted: Any script can run - useful for doing your testing!

To change the policy run the following in Powershell :

set-executionpolicy unrestricted

 

Comments (0)Add Comment
Write comment
 
  smaller | bigger
 

busy