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



Tweet This Tweet This Post!

Related posts:
    Copying Files and Inheriting Security Permissions in Windows
    PowerShell: A Better CMD.EXE
    Getting the PowerShell Version
    Upgrading to Windows PowerShell 2.0 from Community Technology Preview

Share this post:

del.icio.us:Setting Permissions to Run PowerShell Scripts digg:Setting Permissions to Run PowerShell Scripts spurl:Setting Permissions to Run PowerShell Scripts wists:Setting Permissions to Run PowerShell Scripts simpy:Setting Permissions to Run PowerShell Scripts newsvine:Setting Permissions to Run PowerShell Scripts blinklist:Setting Permissions to Run PowerShell Scripts furl:Setting Permissions to Run PowerShell Scripts reddit:Setting Permissions to Run PowerShell Scripts fark:Setting Permissions to Run PowerShell Scripts blogmarks:Setting Permissions to Run PowerShell Scripts Y!:Setting Permissions to Run PowerShell Scripts smarking:Setting Permissions to Run PowerShell Scripts magnolia:Setting Permissions to Run PowerShell Scripts segnalo:Setting Permissions to Run PowerShell Scripts gifttagging:Setting Permissions to Run PowerShell Scripts

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.


One Response to “Setting Permissions to Run PowerShell Scripts”

  1. 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 [...]

Trackback This Post | Subscribe to the comments through RSS Feed

Leave a Reply

CommentLuv badge