Fix “Running Scripts Is Disabled on This System” in PowerShell

To fix “running scripts is disabled on this system” in PowerShell, set the execution policy to RemoteSigned for your account. It doesn’t need admin rights:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

The error means the effective policy is Restricted, which is the default on Windows client PCs. Below I reproduce it, check every policy scope, and show fixes from a single run to a permanent change, tested in PowerShell 7.6 and 5.1.

What the error looks like

I started a window with the Restricted policy and ran a simple script. PowerShell refused to load it:

$shell = (Get-Process -Id $PID).Path
$output = & $shell -NoProfile -ExecutionPolicy Restricted -File C:\psfaqs\Scripts\Get-Greeting.ps1 2>&1 |
    ForEach-Object { $_.ToString() } | Out-String
$text = ($output -replace "$([char]27)\[[0-9;]*m", '' -replace '\s+', ' ')
'Result: Failed.'
[regex]::Match($text, 'File \S+ cannot be loaded because running scripts is disabled on this system\.').Value

Output:

Result: Failed.
File C:\psfaqs\Scripts\Get-Greeting.ps1 cannot be loaded because running scripts is disabled on this system.
PowerShell running scripts is disabled on this system error
Under the Restricted policy, even a local script is blocked (Windows PowerShell 5.1)

Restricted allows commands you type but no script files at all, not even ones you wrote yourself.

Check your execution policy at every scope

The policy can be set in five places, and the first one that isn’t Undefined wins, from top to bottom:

$env:PSExecutionPolicyPreference = $null
$shell = (Get-Process -Id $PID).Path

& $shell -NoProfile -Command { Get-ExecutionPolicy -List } |
    ForEach-Object { '{0,-13} {1}' -f $_.Scope, $_.ExecutionPolicy }

Output:

MachinePolicy Undefined
UserPolicy    Undefined
Process       Undefined
CurrentUser   RemoteSigned
LocalMachine  RemoteSigned
PowerShell Get-ExecutionPolicy -List shows every scope
This PC uses RemoteSigned for the current user (PowerShell 7)

PowerShell 7 and Windows PowerShell 5.1 keep their LocalMachine policies separately, so they can differ, as they do on my PC. Check the shell you actually use.

ScopeWho sets itLasts
MachinePolicy / UserPolicyGroup PolicyUntil the policy changes; you can’t override it
Process-ExecutionPolicy or -Scope ProcessOnly the current PowerShell process
CurrentUserYou, no admin neededPermanently, for your account
LocalMachineAn administratorPermanently, for everyone on the PC

Fix 1: Allow scripts for your account

RemoteSigned runs scripts you create locally and requires a signature only for scripts downloaded from the internet. It’s the right choice for most people:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

On Windows 11, the same setting is in Settings > System > For developers, under PowerShell. If a downloaded script still won’t run afterward, see the file is not digitally signed.

Fix 2: Allow scripts for the current window only

-Scope Process changes the policy just for this PowerShell session, which is handy on locked-down PCs. It’s gone when you close the window:

$shell = (Get-Process -Id $PID).Path
& $shell -NoProfile -ExecutionPolicy Restricted -Command {
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
    "Process scope is now: $(Get-ExecutionPolicy -Scope Process)"
    & C:\psfaqs\Scripts\Get-Greeting.ps1
} 2>$null

Output:

Process scope is now: RemoteSigned
Hello from Get-Greeting.ps1
PowerShell Set-ExecutionPolicy -Scope Process fixes running scripts is disabled
Setting the Process scope lets the script run in this session only (PowerShell 7)

Fix 3: Bypass the policy for one script

To run a single script from a shortcut, scheduled task or another shell, pass -ExecutionPolicy Bypass on the command line:

powershell.exe -ExecutionPolicy Bypass -File C:\Scripts\Get-Greeting.ps1
$shell = (Get-Process -Id $PID).Path
& $shell -NoProfile -ExecutionPolicy Bypass -File C:\psfaqs\Scripts\Get-Greeting.ps1

Output:

Hello from Get-Greeting.ps1

Use pwsh.exe instead of powershell.exe for PowerShell 7. Running scripts from the command line covers passing parameters.

Fix 4: Change it for every user on the PC

From an elevated window, set the LocalMachine scope:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

If Get-ExecutionPolicy -List shows a value under MachinePolicy or UserPolicy, Group Policy controls it and your change won’t take effect. Ask your IT team in that case. Microsoft explains the precedence in about_Execution_Policies and the parameters in the Set-ExecutionPolicy reference.

Is changing the execution policy safe?

The execution policy isn’t a security boundary; it’s a safety net against running scripts by accident. RemoteSigned keeps that net for downloaded files, so it’s a sensible default. Avoid Unrestricted and permanent Bypass.

Frequently Asked Questions

How do I fix “running scripts is disabled on this system”?

Run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, then run your script again.

Do I need admin rights to change the execution policy?

Not for the CurrentUser or Process scope. The LocalMachine scope needs an elevated window.

How do I run a script without changing the execution policy?

Use powershell.exe -ExecutionPolicy Bypass -File .\script.ps1. It only affects that run.

Why doesn’t Set-ExecutionPolicy fix the error?

Group Policy may set the policy. Check Get-ExecutionPolicy -List for MachinePolicy or UserPolicy values.

What is the default execution policy on Windows?

Restricted on Windows client versions and RemoteSigned on Windows Server.

Related script fixes:

Leave a Comment