IT Error Decoder

How to Fix PowerShell execution policy error

Last reviewed

Error message

<script>.ps1 cannot be loaded because running scripts is disabled on this system.

Execution policy is a safety feature, not a security boundary. The right answer is almost always to set it for your user (not the whole machine) and only as permissive as needed.

What this error means

Windows PowerShell's execution policy is set to a value that prevents scripts from running, so even your own .ps1 files won't execute.

Why this happens

Default policy on workstations is Restricted; on servers it's RemoteSigned. Group Policy can lock this down further. The policy applies to scripts on disk — interactive commands always work.

Quick fix (for end users)

  • Open PowerShell as your normal user (not as admin) and set the policy for your user account.

Admin / engineer fix

  • Set policy at CurrentUser scope so only your scripts are affected.

    command
    Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
  • Inspect all scopes to see what's currently effective.

    command
    Get-ExecutionPolicy -List
  • If a Group Policy MachinePolicy is overriding you, only an admin or GPO change can fix it.

Step-by-step fix

  1. Check current policy at all scopes.

    command
    Get-ExecutionPolicy -List
  2. Set a permissive policy for your user.

    command
    Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
  3. Re-run the script.

Affected products

Windows PowerShell 5.1 · PowerShell 7

Common variations of this error

People also see these phrasings of the same problem:

  • File cannot be loaded — execution of scripts is disabled on this system
  • UnauthorizedAccess: cannot be loaded because running scripts is disabled

Still broken? Try these

  • If `Get-ExecutionPolicy -List` shows MachinePolicy = Restricted, your org's GPO is enforcing it. Talk to your admin.
  • For a one-off run, bypass the policy without changing it.
  • Don't use Set-ExecutionPolicy Unrestricted for a one-off script — use -Scope Process instead.

Related errors

Related searches

  • fix powershell execution policy
  • set-executionpolicy currentuser

Frequently asked questions

Should I use Bypass or Unrestricted?

Neither, system-wide. Use `RemoteSigned` for your user account, or `-Scope Process Bypass` for a single shell session.

Why does my admin keep changing it back?

Group Policy enforces execution policy on managed machines. Settings persist after each Group Policy refresh.

Browse more errors in Windows Admin: Fix Windows administration errors. Access denied, RPC server unavailable, trust relationship failures, Group Policy errors, and network path issues. Or paste your own error into the error decoder tool to find a match. You can also go back to the homepage to browse common errors by topic.