When you try to execute a PowerShell script the following error occurs:
File C:\scripts\myscript.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:23 + c:\scripts\myscript.ps1 <<<<
File C:\scripts\myscript.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:23
+ c:\scripts\myscript.ps1 <<<<
CAUSE
By default the PowerShell execution policy is set to restricted, which does not allow the PowerShell Scripts to be run. There are 4 possible execution policies in PowerShell:
SOLUTION:
Use the Set-ExecutionPolicy command to “unlock” you work environment. For example if you are using a lab or learning environment you can issue the following command :
Set-ExecutionPolicy Unrestricted
IMPORTANT: This setting should not be used in a production environment because it could potentially allow scripts downloaded from internet or planted by viruses to be executed. For a production use AllSigned or eventually Remote Signed policies
http://smtpport25.wordpress.com/2009/10/04/powershell-script-will-not-start-due-to-execution-policy-settings/
Regards,Krishnahttp://smtpport25.wordpress.com