How to Change PowerShell Execution Policy in Windows 11 Using Set-ExecutionPolicy

When running automated deployment scripts, custom functions, or administrative tools in Windows 11 PowerShell, you may encounter an error stating that “running scripts is disabled on this system.” This restriction is enforced by PowerShell’s built-in execution policy. Rather than serving as an impenetrable security boundary, the execution policy is a safeguard designed to prevent users from unintentionally triggering malicious or unverified scripts. In Windows 11, you can inspect and configure this policy using the native Set-ExecutionPolicy cmdlet.

Understanding PowerShell Execution Policies

PowerShell provides several distinct execution policy levels that control how configuration files and scripts are evaluated:

  • Restricted (Default in Client Windows): Permits individual commands in the console but blocks all script files (.ps1), including formatting files and configuration profiles.
  • AllSigned: Allows scripts to run only if they have been digitally signed by a trusted publisher. Prompts you to confirm trust before running.
  • RemoteSigned: Allows locally created scripts to execute without digital signatures. However, scripts downloaded from the internet or received via email must carry a valid signature from a trusted publisher.
  • Unrestricted: Runs all scripts regardless of signature. Displays a warning prompt before executing scripts originating from remote sources.
  • Bypass: Completely bypasses all execution restrictions and warnings. Often utilised by automated build systems and enterprise deployment agents.
  • Undefined: Removes the explicitly assigned execution policy from the target scope, falling back to lower-precedence configurations or the operating system default.

How to Check Your Current Execution Policy

Before modifying any configuration, check what execution policy is currently active on your workstation. Open PowerShell and execute:

Get-ExecutionPolicy

To inspect the execution policy across all active scopes—including MachinePolicy, UserPolicy, Process, CurrentUser, and LocalMachine—run:

Get-ExecutionPolicy -List

PowerShell evaluates policies according to strict precedence rules, where Group Policy (MachinePolicy and UserPolicy) overrides workstation settings (CurrentUser and LocalMachine).

How to Change the Execution Policy Using Set-ExecutionPolicy

The recommended policy for developers and power users is RemoteSigned, as it allows personal local scripts to execute while safeguarding against untrusted internet downloads.

Follow these steps to update your policy:

  1. Click the Start button, search for PowerShell, right-click Windows PowerShell (or Terminal), and select Run as administrator.
  2. To set the policy for all users on the local computer, run:
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
  3. PowerShell displays an execution policy change dialogue warning you of the potential risks. Press Y and hit Enter to confirm.

Changing Execution Policy for the Current User Without Admin Rights

If you are working on a machine where you do not possess local administrator rights, you can change the policy exclusively for your own user account:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

This writes the preference directly to your user registry hive (HKEY_CURRENT_USER\Software\Microsoft\PowerShell) without prompting for User Account Control (UAC) elevation.

Temporarily Bypassing Execution Policy for a Single Session

If you only need to run a single administrative script without altering system-wide registry keys, launch a child PowerShell process with the -ExecutionPolicy Bypass parameter:

powershell.exe -ExecutionPolicy Bypass -File .\DeploySystem.ps1

The policy applies exclusively to the lifetime of that specific process and terminates as soon as the script completes, leaving your system defaults untouched.

Troubleshooting Group Policy Overrides

If running Set-ExecutionPolicy returns an error or appears to have no effect, your workstation may be subject to enterprise Active Directory or Microsoft Intune Group Policies. If the MachinePolicy scope is defined, it permanently takes precedence over local configuration. In managed corporate environments, you must contact your network administrator or execute scripts within allowed execution scopes.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.