Fix "running scripts is disabled on this system" in PowerShell
File C:\Desktop\myscript.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
In short
- In Windows PowerShell 5.1, Restricted is the default execution policy for Windows client computers; it permits commands but no scripts1.
- Get-ExecutionPolicy -List shows the policy for each scope in order of precedence: MachinePolicy, UserPolicy, Process, CurrentUser and LocalMachine3.
- Changing the LocalMachine scope needs PowerShell started with Run as administrator; the CurrentUser scope affects only the current user2.
- A Group Policy setting overrides the execution policy in all scopes, and Set-ExecutionPolicy can't change it1,2.
- Windows PowerShell 5.1 and PowerShell 6 or later store the policy separately, so a change in powershell.exe doesn't affect pwsh.exe2.
PowerShell shows "running scripts is disabled on this system" when the execution policy is Restricted5. Restricted allows single commands but no scripts1. Run Get-ExecutionPolicy -List to see the policy in each scope3. Then set RemoteSigned for the current session or for your own account with Set-ExecutionPolicy1. Unblock a downloaded script with Unblock-File only after you check it is safe4.
What the error means
PowerShell's execution policy controls when it loads configuration files and runs scripts1. Under the Restricted policy, PowerShell runs single commands but no script files. That includes .ps1 profiles and .psm1 module files1.
Microsoft ties this message to the Restricted policy5. In Windows PowerShell 5.1, Restricted is the default on Windows client computers1. The policy is not a security boundary. It is a safety feature that stops you from running scripts by accident1.
Before you start
- The fixes below change only the Process and CurrentUser scopes. Only the LocalMachine scope needs PowerShell started with Run as administrator2.
- On a work PC, Group Policy may set the policy. That setting overrides all scopes, and Set-ExecutionPolicy can't change it1,2.
- Windows PowerShell 5.1 (
powershell.exe) and PowerShell 6 or later (pwsh.exe) keep separate settings. Run the fix in the shell that shows the error2. - Execution policies apply only on Windows. On Linux and macOS, the policy is Unrestricted and can't be changed2.
Fixes
Check the current policy. Open PowerShell and run this command. It lists the policy for each scope in order of precedence3.
Get-ExecutionPolicy -ListThe MachinePolicy and UserPolicy rows come from Group Policy1. If either one shows a value other than Undefined, the fixes below can't override it2.
Allow scripts for this session only. Set RemoteSigned for the Process scope. It affects only the current PowerShell session, and the setting is deleted when you close it2.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope ProcessRun your script in the same window. The policy lasts until that window and its child processes close1.
Allow local scripts for your account. Set RemoteSigned for the CurrentUser scope. This is the command Microsoft's docs use1.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserRemoteSigned runs scripts written on your computer. Scripts downloaded from the internet, including email and instant messaging, still need a signature from a trusted publisher1. The change is saved and takes effect at once, with no restart1.
Unblock a downloaded script you trust. Under RemoteSigned, an unsigned script from the internet still fails. The error then says the file "is not digitally signed. The script will not execute on the system."2 Read the script's code and check its source first4. Then unblock it, using your own file path:
Unblock-File -Path .\Start-ActivityTracker.ps1Unblock-File removes the Zone.Identifier stream that marks the file as downloaded4. It doesn't change the execution policy2.
If nothing works
If MachinePolicy or UserPolicy is set, the policy comes from the Turn on Script Execution Group Policy setting1. It overrides PowerShell's own settings in all scopes1. Ask your Group Policy administrator to change it2.
Don't switch to Unrestricted or Bypass to make the error go away. Unrestricted lets unsigned scripts run, with a risk of running malicious scripts1. Bypass blocks nothing and gives no warnings or prompts1.
To undo the change for your account later, set the scope back to Undefined1:
Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope CurrentUserQuestions
- Should I set the execution policy to Unrestricted or Bypass?
- Not to fix this error. Unrestricted lets unsigned scripts run, with a risk of running malicious scripts1. Bypass blocks nothing and shows no warnings; it is designed for scripts built into a larger application with its own security model1.
- Is the execution policy a security boundary?
- No. Microsoft calls it defense in depth, because users can bypass it by typing the script contents at the command line1. It sets basic rules so you don't break them by accident1.
4 Oct 2026: Published.