
You download or write a PowerShell script, run it, and get: "File cannot be loaded because running scripts is disabled on this system." That's the execution policy. On Windows client editions the default is Restricted, which blocks all scripts. You can bypass it for a single run or a single session without lowering security for the whole machine. This guide shows how, explains each policy and scope, and covers the safer long-term setting.
Quick answerBypass it only for the current PowerShell window:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
Or run one script with the policy bypassed:
powershell.exe -ExecutionPolicy Bypass -File .\script.ps1
Neither command changes the machine's saved policy, and neither needs administrator rights.
What the execution policy is (and isn't)
The execution policy decides whether PowerShell loads configuration files and runs scripts. It's a safety feature to stop you running scripts by accident, not a security boundary: anyone can paste a script's contents into the console. Microsoft describes it that way too. So bypassing it for a script you trust is normal admin work; just don't bypass it for scripts you haven't read.
The execution policies
| Policy | What it does |
|---|---|
Restricted | No scripts at all. Default on Windows 10 and 11. |
AllSigned | Only scripts signed by a trusted publisher. |
RemoteSigned | Local scripts run; downloaded scripts must be signed or unblocked. Default on Windows Server. |
Unrestricted | Everything runs; warns before running downloaded scripts. Default on non-Windows PowerShell 7. |
Bypass | Nothing is blocked and there are no warnings. |
Undefined | No policy set in this scope. |
Method 1: Bypass for the current session
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
.\script.ps1
The Process scope lives only as long as this PowerShell window. Close it and the normal policy is back. Answer Y if PowerShell asks to confirm, or add -Force.
Method 2: Bypass for one script
Start a new PowerShell process with the policy set on the command line, which is ideal for shortcuts, batch files and scheduled tasks:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\backup.ps1"
# PowerShell 7
pwsh.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\backup.ps1"
In Task Scheduler, put powershell.exe in Program/script and -NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\backup.ps1" in Add arguments.
Method 3: Unblock a downloaded script
If the policy is RemoteSigned and the script came from the internet, Windows marks it with a "Mark of the Web". After you've checked the script, remove that mark instead of bypassing the policy:
Unblock-File -Path .\script.ps1
# or for a whole folder
Get-ChildItem C:\Scripts -Recurse | Unblock-File
You can also right-click the file → Properties → tick Unblock.
The safer permanent setting: RemoteSigned for your user
If you run your own scripts every day, set RemoteSigned for your account only. It doesn't need admin rights and doesn't affect other users:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Avoid setting Unrestricted or Bypass permanently for LocalMachine; it removes the warning for every script, including ones that arrive by email or download.
Check the current policy and scopes
Get-ExecutionPolicy # effective policy
Get-ExecutionPolicy -List # every scope
Scopes are applied in this order, and the first one that isn't Undefined wins:
MachinePolicy(Group Policy for the computer)UserPolicy(Group Policy for the user)ProcessCurrentUserLocalMachine
Troubleshooting
- "Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope": Group Policy sets
MachinePolicyorUserPolicy. Use the-ExecutionPolicy Bypasscommand-line method, or ask your admin to change the GPO. - Script still blocked in PowerShell 7: Windows PowerShell 5.1 and PowerShell 7 have separate settings. Set the policy in
pwshtoo. - "Access to the registry key is denied": you tried to change
LocalMachinewithout admin rights. Use-Scope CurrentUseror-Scope Process.
Frequently asked questions
How do I bypass the execution policy in PowerShell?
Run Set-ExecutionPolicy Bypass -Scope Process for the current window, or powershell -ExecutionPolicy Bypass -File script.ps1 for one script.
Does -ExecutionPolicy Bypass need administrator rights?
No. The Process scope and the command-line switch work as a normal user. Only changing the LocalMachine scope needs admin rights.
Is Set-ExecutionPolicy Unrestricted safe?
It allows almost any script to run. RemoteSigned for the current user is the better everyday setting.
How do I reset the execution policy to default?
Run Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope CurrentUser (and for LocalMachine as admin). Windows then uses its built-in default.


