Sunday, January 18, 2009

Powershell restricted policy error

Scenario:
I forget to write about it and today when I trying my powershell script on new virtual machine, I got the message that i cant execute this script.

Solution:
Basically, it was because of the fact that out-of-box the default security setting or you can say ExecutionPolicy setting is set to Restricted.

So you need to change it before you can run your script. ( Even if you are Administrator )

Here are some basic commands to check the ExecutionPolicy value, change it to unrestricted and then back to Restricted.

Code:

executionpolicy

set-executionpolicy Unrestricted
Article:
http://www.windowsecurity.com/articles/PowerShell-Security.html

0 comments: