How To Set PowerShell Execution Policy on Windows 11 and 10: A Step-by-Step Guide
Introduction
Dealing with PowerShell scripts can be a pain sometimes. On Windows, the default execution policy is usually pretty strict — like “Restricted” — just to keep things safe. But if you’re trying to run custom scripts, automate stuff, or you’re into development, that restriction might just get in your way. Changing the execution policy isn’t always obvious, especially if you’re not used to digging through settings or using command line. This guide covers a couple of ways to loosen that security guardrail so your scripts can run without unnecessary hassle. By the end, you’ll know how to tweak PowerShell’s policies on both Windows 10 and 11, whether through Settings or directly via commands in PowerShell itself.
How to Fix PowerShell Script Restrictions in Windows 11 and 10
Check Your Current PowerShell Execution Policy
Before messing with anything, it’s good to see what’s already set. On some setups, the default “Restricted” can trip up your scripts, and figuring out what’s there helps avoid surprises.
- Open PowerShell as an administrator. Just search for “PowerShell” in the Start menu, right-click, and choose Run as administrator.
- Type this command and hit Enter:
Get-ExecutionPolicy
- The output tells you what the current policy is. Usually, it’s “Restricted” unless you or some policy has changed it before.
Kind of weird, but sometimes it’s enough to just know what you’re working with before proceeding. If it says “Restricted,” scripts won’t run unless you change it.
Method 1: Change Execution Policy with Windows 11 Settings (Only for Windows 11)
This method is straightforward if you’re on Windows 11. It’s like flipping a toggle, no command line needed. But, honestly, Windows 11 has made it a little confusing to tweak those settings if you don’t know where to look. The goal here is to allow local scripts to run without signing, which is usually sufficient for most dev or automation needs.
- Press Windows + I to open Settings.
- Go to System and click on For Developers.
- Scroll to the PowerShell section. You might see a toggle labeled something like “Allow local scripts to run without signing.” Turn this on.
- This change sets the execution policy to RemoteSigned. It means you can run local scripts freely, but remote scripts need to be signed.
- After toggling that, you should verify it. Just open PowerShell again, run
Get-ExecutionPolicy
, and see if it shows “RemoteSigned” or something similar.
If you’re doing this, keep in mind that on some setups, the toggle might not do much unless you also adjust Group Policy or registry settings. But for most home setups, this works.
Method 2: Change Execution Policy through PowerShell Commands (Works on Windows 10 & 11)
This one’s for anyone comfortable with command line. Using PowerShell commands gives fine control, and it’s how most admins fix this. Known to be reliable across versions.
- Open PowerShell as an administrator — right-click the Start button, select Windows PowerShell (Admin).
- To set the policy for the current user (so it only affects your account), run:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
- When prompted, press A to confirm “Yes to All.” The
-Scope CurrentUser
is safer because it doesn’t affect everyone else on the machine. - If you want to open up restrictions system-wide (not usually recommended unless you really know what you’re doing), use:
Set-ExecutionPolicy RemoteSigned -Scope LocalMachine
. - This latter command requires admin rights and a confirmation prompt. Sometimes, it gets a little hang-up if your group policies override local settings, so keep that in mind.
After changing, check if it worked: run Get-ExecutionPolicy
. It should display “RemoteSigned” or whatever policy you just set.
Extra Tips & Common Issues
It’s a good idea to run PowerShell as administrator always when changing execution policies; otherwise, you might get permission errors. Also, be aware that reducing restrictions can expose your system, especially if you open up to Unrestricted or Bypass — only do that if you understand the risks.
If scripts still won’t run after changing the policy, double-check that no Group Policy is overriding your settings. Sometimes, organizational policies enforce stricter rules for security reasons.
One weird thing — on some setups, it takes a restart or a logoff for changes to fully take effect, especially when changing policies at the system level.
Wrap-up
Getting PowerShell to accept your scripts isn’t super complicated once you get the hang of it. Usually, setting it to RemoteSigned covers most automation and development needs without turning the whole system into a free-for-all. Just be cautious about what policies you set, and always verify after changes.
Summary
- Check current policy with
Get-ExecutionPolicy
- Use Settings if on Windows 11 to toggle script permissions
- Or run
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
in PowerShell as administrator - Verify with
Get-ExecutionPolicy
- Be mindful of security risks when relaxing policies
Fingers crossed this helps
Hopefully, this shaves off a few hours of frustration for someone. Changing execution policies isn’t rocket science, but Windows sure makes it a bit of a puzzle sometimes.