Error Codes Wiki

PowerShell Execution Policy Error — Script Cannot Be Loaded

Warningsystem

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

  1. 1Check current policy: Get-ExecutionPolicy -List (shows all scopes)
  2. 2Set for current user: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
  3. 3For a single session only: Set-ExecutionPolicy Bypass -Scope Process
  4. 4Unblock a specific downloaded script: Unblock-File -Path .\script.ps1
  5. 5Run PowerShell as Administrator to set Machine-scope policies
  6. 6If controlled by Group Policy: contact your IT administrator to adjust the policy

Tags

powershellexecution-policyscript-blockedrestrictedsecurity

More in System

Frequently Asked Questions

RemoteSigned is recommended: it allows local scripts to run freely but requires downloaded scripts to be signed. This balances usability and security.