Skip to content
Follow
Windows

How to Change PowerShell Execution Policies in Windows 11

Richard
Written by
Richard
Mar 4, 2023 Updated Jul 11, 2026 2 min read
How to Enable or Disable Closing Warnings in Windows Terminal
How to Enable or Disable Closing Warnings in Windows Terminal

Managing PowerShell execution policies on Windows 11 controls how the system handles scripts. These settings apply to both standard Windows PowerShell and PowerShell Core.

⚡ Quick Answer

Open PowerShell as an administrator. Type Get-ExecutionPolicy -List to view current policies. Use Set-ExecutionPolicy RemoteSigned -Scope CurrentUser to change it for the current user, or Set-ExecutionPolicy RemoteSigned -Scope LocalMachine for the entire machine.

Why does 🪟 Windows 11 block PowerShell scripts by default?

Windows 11 blocks scripts to prevent malicious code from running automatically. This security model acts as a barrier, ensuring only verified code executes. Unauthorized script execution stays disabled by default, protecting the machine from potential threats and accidental damage.

What happens when you change the execution policy?

Modifying the execution policy changes the rules for which scripts run on the system. Alterations either strengthen security or expose the computer to risks. Always understand the implications before lowering the security posture.

Understanding PowerShell Execution Policies

PowerShell execution policies determine whether the computer runs scripts. Common options include Restricted, which blocks all scripts, and RemoteSigned, which allows locally created scripts while requiring downloaded ones to carry a trusted publisher signature.

  • Restricted: Default setting. No scripts allowed.
  • RemoteSigned: Scripts created locally run; downloaded scripts must be signed by a trusted publisher.
  • AllSigned: Every script must be signed by a trusted publisher.
  • Bypass: Nothing is blocked. Use only for specific, trusted automation tasks.
  • Unrestricted: All scripts run. This is a major security risk.

How to Check and Change Policies

Controlling script security begins with checking the active configuration. Opening PowerShell and running Get-ExecutionPolicy displays the current rule. Applying a policy to an individual user account uses Set-ExecutionPolicy RemoteSigned -Scope CurrentUser. System-wide changes require elevated permissions.

📝Note
Changing system-wide policies requires Administrator privileges.

Configuring the current user takes Set-ExecutionPolicy RemoteSigned -Scope CurrentUser. Modifying the entire machine requires running PowerShell as an administrator and executing Set-ExecutionPolicy RemoteSigned -Scope LocalMachine.

Safer Alternatives: Unblock-File

Unblocking a specific script avoids altering global policies. This approach maintains better security hygiene. The following command accomplishes this task:

💻Code
Unblock-File -Path "C:\Scripts\MyScript.ps1"

Troubleshooting and Group Policy

An error stating that script execution is disabled usually means a Group Policy Object (GPO, a centralized administrative rule set) enforces stricter limits than local settings.

Registry Editor Method

Registry Editor Method (Requires Administrator Privileges)

  1. Navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell
  2. Create a new String Value named ExecutionPolicy.
  3. Set the value to RemoteSigned.
Windows change powershell execution policies via registry
Windows change PowerShell execution policies via the registry
Windows change powershell execution policies via registry value data
Windows change PowerShell execution policies via registry value data

Summary

Keeping the right execution policy active secures the machine while letting necessary automation run smoothly.

Is it safe to set execution policy to Unrestricted?

No, setting the policy to Unrestricted is unsafe. It removes all security checks, allowing any script to execute on the system. This leaves the computer vulnerable to malicious software and unauthorized automation. RemoteSigned provides a much better balance of security and functionality.

Was this guide helpful?

Tags: #Windows 11
Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Change Windows Terminal Themes
Windows How to Change Windows Terminal Themes
How to Reset Group Policy Windows 11 to Default
Windows How to Reset Group Policy Windows 11 to Default
How to Change Windows Terminal Launch Mode in Windows 11
Windows How to Change Windows Terminal Launch Mode in Windows 11
Change Windows Terminal Startup Behavior in Windows 11
Windows Change Windows Terminal Startup Behavior in Windows 11

No comments yet — be the first to share your thoughts!

Leave a Comment

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