October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Redmond desk3 min

PowerShell 101: How to Check and Set the Execution Policy on Windows

Use Get-ExecutionPolicy to check the active policy, -List to find its scope, and Set-ExecutionPolicy to change the intended Windows scope without confusing policy settings with script safety.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run Get-ExecutionPolicy to see the policy currently effective in your PowerShell session. Run Get-ExecutionPolicy -List to find which scope supplies it. On Windows, you can set an intended scope with Set-ExecutionPolicy, then run both checks again. Remember that execution policy controls conditions for loading configuration files and running scripts; it is not a security boundary and does not prove that a script is trustworthy. See Microsoft’s execution-policy overview.

First identify the PowerShell you are using

Windows PowerShell 5.1 runs as powershell.exe; PowerShell 6 and later run as pwsh.exe. They manage execution-policy settings separately, so changing one does not change the other. The setting commands below apply to Windows computers. Microsoft documents that the cmdlet reports Unrestricted on Linux and macOS, so do not apply Windows registry or scope assumptions to those platforms. The Set-ExecutionPolicy reference explains the Windows limitation.

As an Amazon Associate I earn from qualifying purchases.

Check the effective execution policy

  1. Open the PowerShell executable you intend to use.
  2. Run:
    Get-ExecutionPolicy

    This returns the policy effective for the current session.

  3. To see every available scope and diagnose an unexpected result, run:
    Get-ExecutionPolicy -List

The list shows values for MachinePolicy, UserPolicy, Process, CurrentUser, and LocalMachine. A value of Undefined means no policy is assigned at that scope (unless Group Policy is controlling it).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand scope and precedence

Scope determines who is affected and how long a setting lasts:

#1 Best Overall
Sale
PowerShell for Sysadmins: Workflow Automation Made Easy
  • Book - powershell for sysadmins: workflow automation made easy
  • Language: english
  • Binding: paperback
  • MachinePolicy and UserPolicy are supplied by Group Policy. You cannot change them with Set-ExecutionPolicy.
  • Process affects only the current PowerShell session.
  • CurrentUser persists for your user account.
  • LocalMachine persists for the computer and affects all users.

When Group Policy does not define a value, precedence is Process, then CurrentUser, then LocalMachine. Group Policy overrides settings made in PowerShell scopes. Consequently, a successful command can leave the effective policy unchanged; use Get-ExecutionPolicy -List to identify the controlling value. On a managed computer, ask the administrator rather than attempting to bypass organizational policy. Details are in Microsoft’s scope and precedence documentation.

Set a policy at the intended Windows scope

For a per-user change, an example is:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Get-ExecutionPolicy
Get-ExecutionPolicy -List

The change takes effect immediately. This example is not a universal prescription: choose a policy and scope that match your scripts and administration requirements.

CurrentUser versus LocalMachine

CurrentUser changes your account without changing settings for other users. LocalMachine is the default scope if -Scope is omitted, affects everyone on the computer, and requires an elevated PowerShell session. Use the explicit form when setting it:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Set-ExecutionPolicy -ExecutionPolicy <PolicyName> -Scope LocalMachine

Replace <PolicyName> with a documented policy value. If Group Policy supplies a higher-precedence value, the command cannot make that managed value effective.

Temporary session-only changes

To limit a change to the current process, specify -Scope Process. Closing that PowerShell session removes the process-level setting; persistent user and machine settings are unaffected.

What each policy value does

Value Scripts and configuration files Downloaded scripts Local scripts Warnings or prompts
Restricted Does not load configuration files or run scripts. Not applicable because scripts are blocked. Not applicable because scripts are blocked. No script execution.
RemoteSigned Allows scripts. Need a signature from a trusted publisher unless the file is unblocked. Do not require signatures when they were not downloaded from the internet. Downloaded unsigned files can be blocked.
AllSigned Requires all scripts and configuration files to be signed by a trusted publisher. Must be signed. Must also be signed. Unsigned content is blocked.
Unrestricted Allows scripts. Unsigned internet downloads trigger a warning before running. Allowed. Warning for unsigned downloaded scripts.
Bypass Nothing is blocked. No signature requirement. Allowed. No warnings or prompts.
Undefined No assignment at that scope. Behavior comes from another scope or the platform default. Behavior comes from another scope or the platform default. On Windows, if every scope is undefined, the default is Restricted for client computers and RemoteSigned for Windows Server.

These values govern loading and execution conditions, not the trustworthiness of code. In particular, Bypass removes policy blocking and warnings; it should not be used casually as a general fix. Microsoft describes the values in the official overview.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When RemoteSigned blocks a downloaded script

If you have inspected and trust a particular downloaded script, you can remove that file’s downloaded-file mark instead of changing the policy for all scripts. Microsoft documents:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Unblock-File -Path .YourScript.ps1

Read the script and verify that it is safe before using Unblock-File, as advised in the Get-ExecutionPolicy documentation. Unblocking changes the file mark; it does not change execution policy. Signing the script is another option.

Troubleshoot a policy that will not change

  1. Confirm you are in the intended executable (powershell.exe or pwsh.exe) and on Windows.
  2. Run Get-ExecutionPolicy -List.
  3. If MachinePolicy or UserPolicy has a value, Group Policy controls the result; contact your administrator.
  4. If only LocalMachine is being changed, open PowerShell as administrator or choose CurrentUser when a per-user setting is sufficient.
  5. Run Get-ExecutionPolicy again in the same session to verify the effective result.

Official command references

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.