PowerShell Execution Policy Error — Script Cannot Be Loaded
About PowerShell Execution Policy Error
Fix PowerShell 'cannot be loaded because running scripts is disabled on this system' error by understanding and configuring execution policies. 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 execution policy controls which scripts can run on the system. Default policy on Windows is Restricted — no scripts can run, only interactive commands. Error message: 'File cannot be loaded because running scripts is disabled on this system'. Execution policies: Restricted, AllSigned, RemoteSigned, Unrestricted, Bypass. Policy can be set at Machine, User, or Process scope. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.
The most common reasons this occurs include: Default Restricted execution policy blocking all PowerShell scripts. Group Policy enforcing a restrictive execution policy in corporate environments. Script downloaded from internet marked as 'blocked' by Windows zone identifier. Running script in wrong scope (User policy set but running as a different user). Identifying the root cause is the first step toward finding the right solution.
To resolve this, follow these recommended steps: Check current policy: Get-ExecutionPolicy -List (shows all scopes). Set for current user: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser. For a single session only: Set-ExecutionPolicy Bypass -Scope Process. Unblock a specific downloaded script: Unblock-File -Path .\script.ps1. Run PowerShell as Administrator to set Machine-scope policies. If controlled by Group Policy: contact your IT administrator to adjust the policy. 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
What execution policy should I use?
RemoteSigned is recommended: it allows local scripts to run freely but requires downloaded scripts to be signed. This balances usability and security.
Overview
Fix PowerShell 'cannot be loaded because running scripts is disabled on this system' error by understanding and configuring execution policies.
Key Details
- PowerShell execution policy controls which scripts can run on the system
- Default policy on Windows is Restricted — no scripts can run, only interactive commands
- Error message: 'File cannot be loaded because running scripts is disabled on this system'
- Execution policies: Restricted, AllSigned, RemoteSigned, Unrestricted, Bypass
- Policy can be set at Machine, User, or Process scope
Common Causes
- Default Restricted execution policy blocking all PowerShell scripts
- Group Policy enforcing a restrictive execution policy in corporate environments
- Script downloaded from internet marked as 'blocked' by Windows zone identifier
- Running script in wrong scope (User policy set but running as a different user)
Steps
- 1Check current policy: Get-ExecutionPolicy -List (shows all scopes)
- 2Set for current user: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
- 3For a single session only: Set-ExecutionPolicy Bypass -Scope Process
- 4Unblock a specific downloaded script: Unblock-File -Path .\script.ps1
- 5Run PowerShell as Administrator to set Machine-scope policies
- 6If controlled by Group Policy: contact your IT administrator to adjust the policy