Tuesday, May 26, 2009

Error running Powershell Scripts

Now that I’m generating Sharepoint sites using Powershell scripts I noticed an error appearing on the servers.

"File xxx cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.".

image

Turns out that for security reasons running scripts this way is disabled by default.  Check out this blog posting for more information on the various options available.

Solution

From within Powershell type the command “Set-ExecutionPolicy Unrestricted” and then “exit”.