cyprich.com

By

Setting Permissions to Run PowerShell Scripts

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

2 Responses to Setting Permissions to Run PowerShell Scripts

  1. Pingback: Scott’s Blog » Set-ExecutionPolicy RemoteSigned

Leave a Reply

Your email address will not be published. Required fields are marked *