Run Get-ExecutionPolicy to see the policy currently effective in your PowerShell session. Run Get-ExecutionPolicy -List to find which scope supplies it. On Windows, you can set an intended scope with Set-ExecutionPolicy, then run both checks again. Remember that execution policy controls conditions for loading configuration files and running scripts; it is not a security boundary and does not prove that a script is trustworthy. See Microsoft’s execution-policy overview.
First identify the PowerShell you are using
Windows PowerShell 5.1 runs as powershell.exe; PowerShell 6 and later run as pwsh.exe. They manage execution-policy settings separately, so changing one does not change the other. The setting commands below apply to Windows computers. Microsoft documents that the cmdlet reports Unrestricted on Linux and macOS, so do not apply Windows registry or scope assumptions to those platforms. The Set-ExecutionPolicy reference explains the Windows limitation.
As an Amazon Associate I earn from qualifying purchases.
Check the effective execution policy
- Open the PowerShell executable you intend to use.
- Run:
Get-ExecutionPolicyThis returns the policy effective for the current session.
- To see every available scope and diagnose an unexpected result, run:
Get-ExecutionPolicy -List
The list shows values for MachinePolicy, UserPolicy, Process, CurrentUser, and LocalMachine. A value of Undefined means no policy is assigned at that scope (unless Group Policy is controlling it).
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Understand scope and precedence
Scope determines who is affected and how long a setting lasts:
#1 Best Overall
- Book - powershell for sysadmins: workflow automation made easy
- Language: english
- Binding: paperback
- MachinePolicy and UserPolicy are supplied by Group Policy. You cannot change them with
Set-ExecutionPolicy. - Process affects only the current PowerShell session.
- CurrentUser persists for your user account.
- LocalMachine persists for the computer and affects all users.
When Group Policy does not define a value, precedence is Process, then CurrentUser, then LocalMachine. Group Policy overrides settings made in PowerShell scopes. Consequently, a successful command can leave the effective policy unchanged; use Get-ExecutionPolicy -List to identify the controlling value. On a managed computer, ask the administrator rather than attempting to bypass organizational policy. Details are in Microsoft’s scope and precedence documentation.
Set a policy at the intended Windows scope
For a per-user change, an example is:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Get-ExecutionPolicy
Get-ExecutionPolicy -List
The change takes effect immediately. This example is not a universal prescription: choose a policy and scope that match your scripts and administration requirements.
CurrentUser versus LocalMachine
CurrentUser changes your account without changing settings for other users. LocalMachine is the default scope if -Scope is omitted, affects everyone on the computer, and requires an elevated PowerShell session. Use the explicit form when setting it:
Free tools Windows power users keep installed
One-click scans. No signup required.
Set-ExecutionPolicy -ExecutionPolicy <PolicyName> -Scope LocalMachine
Replace <PolicyName> with a documented policy value. If Group Policy supplies a higher-precedence value, the command cannot make that managed value effective.
Rank #3
Temporary session-only changes
To limit a change to the current process, specify -Scope Process. Closing that PowerShell session removes the process-level setting; persistent user and machine settings are unaffected.
What each policy value does
| Value | Scripts and configuration files | Downloaded scripts | Local scripts | Warnings or prompts |
|---|---|---|---|---|
Restricted |
Does not load configuration files or run scripts. | Not applicable because scripts are blocked. | Not applicable because scripts are blocked. | No script execution. |
RemoteSigned |
Allows scripts. | Need a signature from a trusted publisher unless the file is unblocked. | Do not require signatures when they were not downloaded from the internet. | Downloaded unsigned files can be blocked. |
AllSigned |
Requires all scripts and configuration files to be signed by a trusted publisher. | Must be signed. | Must also be signed. | Unsigned content is blocked. |
Unrestricted |
Allows scripts. | Unsigned internet downloads trigger a warning before running. | Allowed. | Warning for unsigned downloaded scripts. |
Bypass |
Nothing is blocked. | No signature requirement. | Allowed. | No warnings or prompts. |
Undefined |
No assignment at that scope. | Behavior comes from another scope or the platform default. | Behavior comes from another scope or the platform default. | On Windows, if every scope is undefined, the default is Restricted for client computers and RemoteSigned for Windows Server. |
These values govern loading and execution conditions, not the trustworthiness of code. In particular, Bypass removes policy blocking and warnings; it should not be used casually as a general fix. Microsoft describes the values in the official overview.
Rank #4
When RemoteSigned blocks a downloaded script
If you have inspected and trust a particular downloaded script, you can remove that file’s downloaded-file mark instead of changing the policy for all scripts. Microsoft documents:
Unblock-File -Path .YourScript.ps1
Read the script and verify that it is safe before using Unblock-File, as advised in the Get-ExecutionPolicy documentation. Unblocking changes the file mark; it does not change execution policy. Signing the script is another option.
Quick Recap
Best Value
Troubleshoot a policy that will not change
- Confirm you are in the intended executable (
powershell.exeorpwsh.exe) and on Windows. - Run
Get-ExecutionPolicy -List. - If
MachinePolicyorUserPolicyhas a value, Group Policy controls the result; contact your administrator. - If only
LocalMachineis being changed, open PowerShell as administrator or chooseCurrentUserwhen a per-user setting is sufficient. - Run
Get-ExecutionPolicyagain in the same session to verify the effective result.
Official command references
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.




