• Facebook
  • RSS Feed
  • Instagram
  • LinkedIn
  • Twitter
Dec 032009
 

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

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)