Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Execution Policy

How to Fix PowerShell Commands Blocked by Execution Policy or Permissions

By Freedom251 Team · · 11 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

PowerShell failures that mention running scripts is disabled on this system usually come from an execution-policy scope, while Access to the registry key … is denied usually means the command tried to change the machine-wide policy without elevation. The fix is to identify the exact error, inspect every policy scope, and change only the narrowest scope that meets your need. Use an elevated window only for a LocalMachine change. If Group Policy sets MachinePolicy or UserPolicy, a local command cannot override it; an administrator must change the organization’s policy.

Why does PowerShell say running scripts is disabled on this system? Why do I get access denied when I run Set-ExecutionPolicy? This guide answers both questions and covers Windows PowerShell 5.1, PowerShell 7 on Windows, and PowerShell 6 or later on non-Windows systems. Microsoft’s policy definitions and precedence are documented in about_Execution_Policies.

As an Amazon Associate I earn from qualifying purchases.

Read the exact error before changing anything

Do not treat every UnauthorizedAccessException as an execution-policy problem. The command, resource, and wording identify different failure classes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

“Running scripts is disabled on this system”

This message indicates that PowerShell refused to run a script under the effective execution policy. It commonly appears when a script is blocked by a restrictive policy or when a downloaded script is unsigned under RemoteSigned. First determine which scope supplies the effective value; changing a lower-precedence scope may have no visible effect.

“Access to the registry key … is denied”

This wording commonly appears when Set-ExecutionPolicy is attempting to write the Windows machine-wide policy without administrator rights. Omitting -Scope makes the target LocalMachine, so a normal PowerShell window cannot write that setting. The command itself may be valid; the account simply lacks permission for that scope.

Other access-denied errors

An error naming a file, folder, service, registry path, or another resource may be an ordinary Windows permission problem unrelated to execution policy. Keep the named resource and the command in view while troubleshooting instead of repeatedly changing policy.

Inspect the effective policy and every scope

Run these commands in the same shell in which the script fails:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Get-ExecutionPolicy
Get-ExecutionPolicy -List

Get-ExecutionPolicy reports the effective policy only. Get-ExecutionPolicy -List displays the value configured at each scope, allowing you to see why the effective value differs from what you expected. The scopes are evaluated in precedence order: MachinePolicy, UserPolicy, Process, CurrentUser, and LocalMachine. Group Policy scopes are administrator-controlled and take precedence over local settings. When Group Policy is not controlling execution policy, a Process value can temporarily take precedence over CurrentUser and LocalMachine.

Scope Duration and reach Who can normally change it Important behavior
Process Only the current PowerShell process and child processes; discarded when they close The user who started the process, subject to organizational policy Useful for a one-session test; it does not persist
CurrentUser Persists for one Windows user That user, where policy permits Does not affect other users or require a machine-wide change
LocalMachine Persists for all users on the computer An elevated administrator on Windows The default target when -Scope is omitted
UserPolicy Persistent policy for the user, delivered by Group Policy Organization administrators Overrides local CurrentUser and LocalMachine settings
MachinePolicy Persistent policy for the computer, delivered by Group Policy Organization administrators Overrides local settings and cannot be defeated with a local command

For example, a user may set CurrentUser to RemoteSigned and still see a different effective value because MachinePolicy or UserPolicy is populated. Conversely, a command that succeeds at Process scope affects only that shell. Always read the list after making a change so you can confirm which scope is winning.

Choose the narrowest policy change that solves the problem

Use Process scope for a temporary session

For a one-off script or a diagnostic session, set the policy only for the current process:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process

The setting disappears when that PowerShell process and its child processes close. It does not alter the user or computer policy, making it the least persistent local change. If MachinePolicy or UserPolicy is enforcing a value, the process setting cannot override it; inspect the list and involve the administrator instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use CurrentUser for a persistent setting for one user

If you regularly run your own scripts and do not need to change settings for other accounts, configure the user scope:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

This is the usual per-user remedy on Windows when no Group Policy scope blocks it. It avoids writing the machine-wide registry location and therefore avoids the elevation requirement associated with LocalMachine. Confirm the result:

Get-ExecutionPolicy -List
Get-ExecutionPolicy

Microsoft’s PowerShell 101 guidance says: “Unless you’re signing your scripts, I recommend using the RemoteSigned execution policy.” That is Microsoft’s getting-started recommendation, not a guarantee that every organization permits it or that every script is safe.

Use LocalMachine only when all users need the change

A machine-wide change affects every user and requires an elevated Windows PowerShell or PowerShell 7 window. Start the shell with Run as administrator, then run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

Because LocalMachine is the default when -Scope is omitted, this command has the same target:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

Do not use the second form as an accidental shortcut for a personal fix. If the command reports that access to the registry key is denied, close it, open a new elevated shell, and retry, or use CurrentUser if only your account needs the setting. Changing LocalMachine unnecessarily broadens the impact and requires administrative rights.

Fix a downloaded script without broadening policy

RemoteSigned can block an unsigned script that Windows identifies as downloaded from the internet. A policy change is not always necessary for that single file. First inspect the script’s contents and verify its source and behavior. Microsoft’s documentation states: “A best practice is to read the script’s code and verify it’s safe before using the Unblock-File cmdlet.”

After that review, unblock only the identified file:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Unblock-File -Path .script.ps1

Run the script again in the same directory. Unblock-File changes the file’s download-blocking metadata; it does not change the execution policy for your user, computer, or future downloads. Never use it as a way to make an unknown script run merely because a policy message appeared. If several files belong to a trusted package, review each file and the package’s source before deciding whether to unblock them.

Handle Group Policy and managed computers correctly

When Get-ExecutionPolicy -List shows a value under MachinePolicy or UserPolicy, that value comes from Group Policy. Those scopes override settings made with Set-ExecutionPolicy. A local command can report success while the effective policy remains controlled by Group Policy, so verify the effective value rather than assuming the command changed behavior.

There is no local syntax that legitimately defeats an enforced organizational policy. Contact the administrator or security team with the exact script, error text, and output of Get-ExecutionPolicy -List. They can decide whether the script should be signed, whether the policy should be adjusted, or whether an approved deployment method should be used. Do not advise users to delete policy registry values or bypass management controls.

Check which PowerShell you are actually running

Windows PowerShell 5.1 (powershell.exe) and PowerShell 6 or later (pwsh.exe) store execution policy separately on Windows. A policy set in one shell does not automatically become the policy for the other. If a command works in one window and fails in another, identify the executable first and run Get-ExecutionPolicy -List in both.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

PowerShell 6 and later on non-Windows systems defaults to Unrestricted and cannot change execution policy. In that environment, an execution-policy fix is not the right explanation for a file-permission, interpreter, shebang, or operating-system security error. Use the platform’s permission and execution diagnostics instead, while retaining the exact error text.

Separate execution-policy failures from ordinary permissions

Execution policy governs whether PowerShell will run scripts; it does not grant access to protected files, folders, registry keys, services, or network resources. After policy inspection, retry the command and note what resource the error names.

  • If the message still says scripts are disabled, compare the effective policy with the policy list and check for Group Policy.
  • If the message names the registry key used by Set-ExecutionPolicy, use an elevated shell for LocalMachine or target CurrentUser.
  • If the message names a project folder or data file, request or correct that resource’s Windows permissions; changing execution policy will not help.
  • If a script starts but then fails while opening a file, connecting to a service, or loading a module, troubleshoot that operation separately from the policy decision.

This distinction prevents a broad policy relaxation from masking an unrelated authorization defect.

A reliable troubleshooting sequence

  1. Capture the complete error. Copy the command, the first error line, and the resource named in the message. “Running scripts is disabled on this system” and a registry-key access denial lead to different fixes.
  2. Identify the shell. Determine whether the window is running powershell.exe (Windows PowerShell 5.1) or pwsh.exe (PowerShell 6 or later), and whether the operating system is Windows.
  3. Inspect all scopes. Run Get-ExecutionPolicy -List, then Get-ExecutionPolicy. Record any MachinePolicy or UserPolicy value before changing local settings.
  4. Pick a scope deliberately. Use Process for one session, CurrentUser for one user, and LocalMachine only when every user needs the policy and you can elevate.
  5. Apply and verify. Run the scoped Set-ExecutionPolicy command, then repeat both inspection commands. If the effective value does not change, a higher-precedence scope is controlling it.
  6. Address downloaded-file blocking. Review the script, verify it is safe, and use Unblock-File -Path .script.ps1 for that file instead of changing a broader scope.
  7. Retry and classify the next error. If the policy message is gone but a file, registry, service, or network resource is denied, continue with that resource’s permissions rather than altering execution policy again.

Security decisions and practical examples

Running a trusted personal script once

Open the normal shell, inspect the current scopes, set RemoteSigned at Process scope if permitted, and run the script. Closing the window removes the temporary setting. This keeps the change limited to the task and avoids an administrator request.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Using scripts routinely under your own account

After reviewing the scripts and their sources, set RemoteSigned at CurrentUser. This persists for your account while leaving other users’ settings unchanged. If the effective value remains different, check for UserPolicy or MachinePolicy and ask the administrator rather than stacking more local commands.

Supporting scripts for every account on a shared Windows computer

Document the reason, review the scripts, and have an administrator open the shell with Run as administrator before setting LocalMachine. Tell affected users which executable—Windows PowerShell or PowerShell 7—they should use, because their policy stores are separate.

A downloaded vendor or community script

Do not immediately set a less restrictive policy or use a blanket unblock command. Read the code, verify the publisher and intended behavior, and unblock only the reviewed path if the file is trustworthy. If organizational policy forbids unblocking, follow the organization’s approved signing or deployment process.

Common mistakes that make the problem look worse

  • Omitting -Scope unintentionally. The command then targets LocalMachine, which explains a registry-key denial in a non-elevated window.
  • Changing the wrong shell. A successful change in powershell.exe does not automatically change pwsh.exe, and vice versa.
  • Checking only the effective value. Get-ExecutionPolicy cannot tell you which scope supplied it. Always pair it with Get-ExecutionPolicy -List.
  • Repeating local changes under Group Policy. If MachinePolicy or UserPolicy is populated, more CurrentUser or LocalMachine commands will not replace the enforced value.
  • Unblocking before reviewing. Unblock-File is file-specific, but it should be used only after checking the script and its source.
  • Assuming policy grants permissions. It does not authorize access to a protected data file, service, registry path, or network location.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to document the issue for an administrator

When a managed computer needs help, send the complete error rather than a paraphrase. Include the command you ran, the script path, the executable in use—powershell.exe or pwsh.exe—and the output of Get-ExecutionPolicy -List. State whether the file was downloaded and whether you reviewed its contents. This gives the administrator enough context to distinguish a blocked script, a LocalMachine elevation problem, a Group Policy decision, and an unrelated resource permission.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not remove policy entries, edit policy storage directly, or recommend a broad machine-wide change simply to make one script run. An administrator may instead require a signed script, approve a deployment method, adjust the managed policy, or tell you to use an approved shell.

Reference documentation

For scope precedence, Group Policy behavior, and policy mechanics, see Microsoft’s about_Execution_Policies. For LocalMachine defaults, elevation, platform distinctions, and the Unblock-File example, see Set-ExecutionPolicy. Microsoft’s error-reading and permission-denied examples are in Getting Started with PowerShell – PowerShell 101.

Frequently Asked Questions

Why does PowerShell say running scripts is disabled on this system?

PowerShell is refusing the script under its effective execution policy. Run Get-ExecutionPolicy -List and Get-ExecutionPolicy in the failing shell to find the controlling scope. If a downloaded unsigned file is blocked under RemoteSigned, review it and consider Unblock-File for that file only.

Why do I get access denied when I run Set-ExecutionPolicy?

If you omit -Scope, the command targets LocalMachine. On Windows that machine-wide setting requires an elevated shell. Open PowerShell with Run as administrator, or use -Scope CurrentUser when only your account needs the setting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which scope should I choose?

Use Process for a temporary current-session change, CurrentUser for a persistent setting for one user, and LocalMachine only when all users need it and an administrator can elevate. MachinePolicy and UserPolicy are controlled by Group Policy and take precedence.

Why did Set-ExecutionPolicy succeed but the effective policy did not change?

A higher-precedence scope is probably supplying the value. Check Get-ExecutionPolicy -List for MachinePolicy or UserPolicy. A local command cannot override an enforced Group Policy setting.

Is Unblock-File safer than changing execution policy?

It is narrower because it changes the download-blocking metadata for one file instead of changing a user or computer policy. Still, inspect the script, verify its source and behavior, and unblock only a file you trust.

Will changing execution policy fix a denied project file or registry path?

No. Execution policy governs whether PowerShell runs scripts; it does not grant access to protected files, folders, registry keys, services, or network resources. Troubleshoot the permissions on the resource named in the error.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why does a policy change work in Windows PowerShell but not PowerShell 7?

Windows PowerShell 5.1 uses powershell.exe and PowerShell 6 or later uses pwsh.exe. On Windows they store execution policy separately, so inspect the scopes in the executable where the script actually fails.

Can I change execution policy on non-Windows PowerShell 6 or later?

PowerShell 6 and later on non-Windows systems defaults to Unrestricted and cannot change execution policy. A failure there usually requires platform-specific file, interpreter, shebang, or operating-system permission troubleshooting instead.

The Bottom Line

Start with the exact error, then run Get-ExecutionPolicy -List and Get-ExecutionPolicy in the same shell. Prefer Process for a temporary test and CurrentUser for one user. Use an elevated LocalMachine change only when every user needs it. Review downloaded scripts before using Unblock-File, and involve an administrator whenever Group Policy controls the result.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Execution PolicyGroup PolicyPowerShellRemoteSignedSet-ExecutionPolicyUnblock-FileWindows permissions

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.