Home » How To » How to Change PowerShell Execution Policy in Windows 10 & 11

How to Change PowerShell Execution Policy

By default, PowerShell restricts you from running external scripts and commands. This is due to its default Restricted execution policy. The good thing is that changing the PowerShell’s execution policy to allow you to run scripts is easier than you think. In this tutorial, we’ll show two ways to set the execution policy in PowerShell. Let’s get started.

How to Check the Current Execution Policy

Press Start, type PowerShell, right-click on it and select Run as Administrator to open PowerShell as admin. In the PowerShell window, type Get-ExecutionPolicy and press Enter. This will display your current execution policy. In my case, the active policy is Restricted.

Get current powershell execution policy

Change Execution Policy Using Settings App

On Windows 11, you can change the execution policy using the Settings app. Here’s how:

Note: Windows 10 users can follow the second method.

Press the Windows key + I to open the Windows 11 Settings app. Once it opens, navigate to the System > For Developers page.

click on for developer option

On this page, click on the PowerShell option and turn on the “Change execution policy to allow local PowerShell scripts to run without signing. Require signing for remote scripts.” toggle. This will set the PowerShell execution policy to RemoteSigned.

turn on script execution option

That’s it. You can now run external scripts and commands without errors.

Change Execution Policy Using PowerShell

Press Windows key + X and select Terminal (Admin) to open the terminal. Windows 10 users can select the Windows PowerShell (Admin) option.

Open powershell as admin

In the PowerShell window, execute the following command to set RemoteSigned as the default execution policy for your user account.

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

To change the execution policy for all users, use the following command instead.

Set-ExecutionPolicy RemoteSigned -Scope LocalMachine

Note: RemoteSigned is the recommended execution policy to run external scripts and commands. However, you can also set other values such as the ones listed below. If you want to learn more about them, take a look at the What Are Execution Policies? section below.

  • Restricted (default)
  • AllSigned
  • Unrestricted
  • Bypass
  • Undefined
run command to change PowerShell execution policy

If you see a confirmation prompt, type A and press Enter to confirm the execution policy change.

To verify the policy change, execute the Get-ExecutionPolicy cmdlet again and you should see it return RemoteSigned.

Verify powershell execution policy change

That is all. It is simple to change the PowerShell execution policy.

What Are Execution Policies?

Think of PowerShell’s execution policies as a set of conditions that must be met for scripts or configuration files to run. While the execution policy can prevent loading configuration files and executing scripts, it is not a security measure and can be bypassed easily, as I’ve shown above. It is there only to prevent you and others from running scripts that could be harmful.

PowerShell has six execution policies. They are as follows.

Restricted: This is the default execution policy for all Windows PCs and blocks all scripts, modules, and configuration files. However, you can run built-in PowerShell commands without any problem.

All Signed: This policy requires that all scripts (including the ones you write) and configuration files be signed by a trusted publisher. If a script is not signed by a trusted publisher at the time of execution, PowerShell will prompt you to classify the publisher as trusted or untrusted. If you choose to trust the publisher, PowerShell will execute the script or load the configuration file; otherwise, it will block it.

RemoteSigned: This is the default policy for all Windows servers. It allows you to run scripts that you’ve written yourself and those from trusted publishers. If a script or configuration file is downloaded from the internet and not signed by a trusted publisher, you may have to use the Unblock-File cmdlet to run it.

Unrestricted: This is the default policy for all non-Windows PCs. It lets you run all scripts and load configuration files without any restrictions.

Bypass: This policy is mainly intended for large-scale applications which use PowerShell as its foundation. It lets you run all scripts and load configuration files without any restrictions or warnings.

Undefined: Setting the execution policy to ‘Undefined’ means that there’s no execution policy set for the current scope. If all scopes (MachinePolicy, UserPolicy, Process, CurrentUser, and LocalMachine) are set to ‘Undefined’, the policy will revert to ‘Restricted’.

I hope this simple Windows how-to guide helped you.

If you like this article, do check how to zoom in and out in PowerShell and how to run PowerShell scripts on schedule.

Update: The tutorial was updated to include another method for Windows 11 users and update the PowerShell command to work on all systems.

2 thoughts on “How to Change PowerShell Execution Policy”

  1. Avatar for amna

    what to do if it says
    C:\Windows\system32>Get-ExecutionPolicy
    ‘Get-ExecutionPolicy’ is not recognized as an internal or external command,
    operable program or batch file.

    1. Avatar for Bashkarla

      I think you are executing the command in the Command Prompt.

      You should execute it in PowerShell. You can open PowerShell by searching for it in the Start menu.

Leave a Comment

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

Scroll to Top