How to Enable Running Scripts on Windows 11 (PowerShell Execution Policy)

If you see “cannot be loaded because running scripts is disabled on this system” when you run a PowerShell script (.ps1) on Windows 11, PowerShell’s execution policy is blocking it. By default, Windows 11 client PCs use the Restricted policy, which lets you type commands but not run script files. This guide shows how to allow scripts safely, only for your account or only for one session, and how to turn the protection back on.

Quick Answer

Open PowerShell and run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser. Type Y if prompted. Local scripts now run, while scripts downloaded from the internet must be signed or unblocked first.

PowerShell window showing the running scripts is disabled error, followed by the Set-ExecutionPolicy RemoteSigned CurrentUser command highlighted and the new policy list
(1) The “running scripts is disabled” error; (2) setting RemoteSigned for the current user fixes it.

Understand Execution Policies

Policy What it allows
Restricted No scripts; individual commands only (Windows client default)
AllSigned Only scripts signed by a trusted publisher
RemoteSigned Local scripts run; downloaded scripts must be signed (recommended)
Unrestricted All scripts, with a warning for downloaded ones
Bypass Nothing blocked, no warnings (for automation)

Execution policy is a safety feature, not a security boundary. It helps prevent accidentally running scripts, but it doesn’t stop a determined attacker.

Method 1: Allow Scripts for Your Account (Recommended)

  1. Right-click Start and open Terminal (PowerShell). Admin rights aren’t needed for this scope.
  2. Run: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
  3. Confirm with Y if asked.
  4. Check it: Get-ExecutionPolicy -List should show CurrentUser RemoteSigned.

Method 2: Use the Windows 11 Settings Toggle

  1. Open Settings > System > For developers.
  2. Expand PowerShell and turn on Change execution policy to allow local PowerShell scripts to run without signing. Remote scripts still need signing.

This applies the RemoteSigned policy. The option’s location may vary between Windows 11 versions.

Method 3: Allow Scripts for One Session Only

  • In an open window: Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process. It resets when you close the window.
  • For a single script: powershell -ExecutionPolicy Bypass -File .\setup.ps1

Method 4: All Users (Administrator)

Open Terminal as administrator and run Set-ExecutionPolicy RemoteSigned -Scope LocalMachine. Use this only if every user on the PC needs to run scripts.

Run a Downloaded Script

With RemoteSigned, scripts downloaded from the internet are blocked until you unblock them. After confirming the script is from a trusted source and reviewing its contents:

  • Run Unblock-File -Path .\script.ps1, or
  • Right-click the file, choose Properties, check Unblock, and click OK.

Turn Protection Back On

Run Set-ExecutionPolicy -ExecutionPolicy Restricted -Scope CurrentUser (or Undefined to fall back to the default).

Troubleshooting

  • “Windows PowerShell updated your execution policy successfully, but the setting is overridden”: a Group Policy (MachinePolicy or UserPolicy) takes precedence. On work PCs, ask IT.
  • Access denied for LocalMachine: open Terminal as administrator, or use -Scope CurrentUser instead.
  • Still blocked: the file may be marked as downloaded. Use Unblock-File.
  • PowerShell 7: it has its own policy settings; run the same commands in PowerShell 7 (pwsh).

Frequently Asked Questions

Is RemoteSigned safe?

It’s Microsoft’s default for Windows Server and a reasonable balance for most users. Only run scripts you trust.

Does this affect batch (.bat) files?

No. Execution policy only applies to PowerShell scripts.

Summary

  1. Run Set-ExecutionPolicy RemoteSigned -Scope CurrentUser.
  2. Or turn on the PowerShell option in Settings > System > For developers.
  3. Use -Scope Process or -ExecutionPolicy Bypass for one-time runs.
  4. Unblock trusted downloaded scripts with Unblock-File.