Setting Permissions to Run PowerShell Scripts
Posted by Johan Cyprich on 23 Apr 2009 | Tagged as: How To
When PowerShell is installed, it sets the default execution policy to Restricted which allows commands to be executed, not scripts. I don’t think this is the best approach for the application since the scripting is the main reason why people would install and use PowerShell.
You can determine what the execution policy is with this command:
Get-ExecutionPolicy
There are 4 options for execution policy: Restricted, AllSigned, RemoteSigned, and Unrestricted. The last 3 options allow scripts to be run in the shell. I prefer using the RemoteSigned policy over AllSigned because it doesn’t require a digital signature from a trusted publisher to run scripts.
You can set the execution policy for running scripts with the following command:
Set-ExecutionPolicy RemoteSigned
| Related posts: | |
|
|
Share this post:
Follow Me:
Did you find this post interesting and useful? You can keep up to date on this blog by subscribing to my RSS feed, or you can have new posts sent to you by e-mail. You can also follow me on Twitter.
1 Comment »
Tweet This Post!
















Loading...
on 01 Feb 2010 at 8:26 am 1.Scott’s Blog » Set-ExecutionPolicy RemoteSigned said …
[...] I first tripped over this, the resource that helped most was a TechNet article. Later, I found a blog post that was more specific about the execution policies. Categories: Opinion, Software Development [...]