PowerShell Execution Policy Restricted — Scripts Cannot Be Run on This System
About PowerShell Execution Policy Restricted
Fix PowerShell 'running scripts is disabled on this system' error caused by the execution policy preventing script files from executing. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.
Here are the key things to understand: PowerShell's execution policy controls whether scripts (.ps1 files) are allowed to run. Default policy on Windows is 'Restricted' which blocks all script execution. The error 'cannot be loaded because running scripts is disabled on this system' appears for any .ps1 file. Execution policies: Restricted, AllSigned, RemoteSigned, Unrestricted, Bypass. This is a safety feature to prevent accidentally running malicious scripts. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.
The most common reasons this occurs include: Default execution policy is Restricted on fresh Windows installations. Group Policy enforcing a restrictive execution policy organization-wide. User trying to run a downloaded script that has the Mark of the Web (MOTW). Execution policy set at a higher scope (Machine/Group Policy) overriding user preference. Identifying the root cause is the first step toward finding the right solution.
To resolve this, follow these recommended steps: Check current policy: run 'Get-ExecutionPolicy -List' in PowerShell to see all scopes. Set to RemoteSigned (recommended): run 'Set-ExecutionPolicy RemoteSigned -Scope CurrentUser' in admin PowerShell. For one-time script execution: run 'powershell -ExecutionPolicy Bypass -File script.ps1'. Unblock a specific downloaded script: right-click > Properties > check 'Unblock' or run 'Unblock-File script.ps1'. For development: use RemoteSigned which allows local scripts but requires downloaded scripts to be signed. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.
This article is part of our Windows Error Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.
Quick Answer
Is it safe to change execution policy to RemoteSigned?
RemoteSigned is the recommended setting for most users. It allows locally created scripts to run freely while requiring downloaded scripts to be digitally signed. It balances security and usability.
Overview
Fix PowerShell 'running scripts is disabled on this system' error caused by the execution policy preventing script files from executing.
Key Details
- PowerShell's execution policy controls whether scripts (.ps1 files) are allowed to run
- Default policy on Windows is 'Restricted' which blocks all script execution
- The error 'cannot be loaded because running scripts is disabled on this system' appears for any .ps1 file
- Execution policies: Restricted, AllSigned, RemoteSigned, Unrestricted, Bypass
- This is a safety feature to prevent accidentally running malicious scripts
Common Causes
- Default execution policy is Restricted on fresh Windows installations
- Group Policy enforcing a restrictive execution policy organization-wide
- User trying to run a downloaded script that has the Mark of the Web (MOTW)
- Execution policy set at a higher scope (Machine/Group Policy) overriding user preference
Steps
- 1Check current policy: run 'Get-ExecutionPolicy -List' in PowerShell to see all scopes
- 2Set to RemoteSigned (recommended): run 'Set-ExecutionPolicy RemoteSigned -Scope CurrentUser' in admin PowerShell
- 3For one-time script execution: run 'powershell -ExecutionPolicy Bypass -File script.ps1'
- 4Unblock a specific downloaded script: right-click > Properties > check 'Unblock' or run 'Unblock-File script.ps1'
- 5For development: use RemoteSigned which allows local scripts but requires downloaded scripts to be signed