I am pretty new to the PowerShell arena, so I was a little surprised with this error when I tried testing a script:
File C:\script.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:19
Of course once I researched it, I quickly found that it is to protect the system from running malicious scripts. This technet post from The Scripting Guys really helped (http://technet.microsoft.com/en-us/library/ee176949.aspx)
The PowerShell Execution Policy is set to Restricted by default prevent the use of scripts.
From the PowerShell prompt
Restricted should be returned.
You should now be able to run your script. This setting will remain even if you exit the PowerShell Session.
Restricted – No scripts can run.
Unrestricted – All scripts can run.
RemoteSigned – Run self-created scripts, but require scripts obtained from other sources to be signed by a trusted publisher.
AllSigned – Require ALL scripts to be signed by a trusted publisher.