PowerShell Execution Policy Settings


CC 2.0 image courtesy GarrettTT on Flickr

If you have ever tried to run a PowerShell script on a new system, you probably have encountered the following error: “{File Name} cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details“.


This post looks at the solution to resolve this issue.


The reason the error message is displayed is due to the security settings within PowerShell. The ExecutionPolicy determines if scripts may run on your computer. The default setting (in Windows 8, Windows Server 2012, and Windows 10) is Restricted.

To view the current execution policy on your machine, use the Get-ExecutionPolicy PowerShell command:




There are four different execution policies in PowerShell:

  • Restricted – No scripts can be run. Windows PowerShell can be used only in interactive mode.
  • AllSigned – Only scripts signed by a trusted publisher can be run.
  • RemoteSigned – Downloaded scripts must be signed by a trusted publisher before they can be run.
  • Unrestricted – No restrictions; all Windows PowerShell scripts can be run.

To change the execution policy on your machine, use the Set-ExecutionPolicy PowerShell command:


To see more details about Set-ExecutionPolicy, use the Help feature:

Get-Help Set-ExecutionPolicy


To use the Set-ExecutionPolicy command, it must be executed in a PowerShell window with elevated administrator permissions. To do so, right-click Windows PowerShell and select Run as Administrator. Once you are in an elevated prompt, run the following command:

Set-ExecutionPolicy Unrestricted

The execution policy on your machine has been changed.


Note: If you want to revert PowerShell to its original Restricted execution policy to prevent future scripts from running, use the following command via an elevated command prompt:

Set-ExecutionPolicy Restricted


This article has shown you how to change the execution policy on your computer so you can successfully run PowerShell scripts.

About Ken Cenerelli
I am a technical writer/programmer writer/content developer, .NET developer, Microsoft MVP, public speaker, blogger, and Microsoft Azure nerd. I blog about technology at kencenerelli.wordpress.com and am on Twitter via @KenCenerelli.

One Response to PowerShell Execution Policy Settings

  1. Pingback: Unblock downloaded PowerShell scripts | Ken Cenerelli

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: