Error Codes Wiki

PowerShell Execution Policy Restricted — Scripts Cannot Be Run on This System

Warningsystem

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

  1. 1Check current policy: run 'Get-ExecutionPolicy -List' in PowerShell to see all scopes
  2. 2Set to RemoteSigned (recommended): run 'Set-ExecutionPolicy RemoteSigned -Scope CurrentUser' in admin PowerShell
  3. 3For one-time script execution: run 'powershell -ExecutionPolicy Bypass -File script.ps1'
  4. 4Unblock a specific downloaded script: right-click > Properties > check 'Unblock' or run 'Unblock-File script.ps1'
  5. 5For development: use RemoteSigned which allows local scripts but requires downloaded scripts to be signed

Tags

powershellexecution-policyrestrictedscriptssecurity

Related Items

More in System

Frequently Asked Questions

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.