This tutorial will show you different ways on how to set the PowerShell script execution policy for the current user, local machine, or current process in Windows 10 and Windows 11.
PowerShell's execution policy is a safety feature that controls the conditions under which PowerShell loads configuration files and runs scripts. This feature helps prevent the execution of malicious scripts.
On a Windows computer you can set an execution policy for the local computer, for the current user, or for a particular session. You can also use a Group Policy setting to set execution policies for computers and users.
Execution policies for the local computer and current user are stored in the registry. You don't need to set execution policies in your PowerShell profile. The execution policy for a particular session is stored only in memory and is lost when the session is closed.
The execution policy isn't a security system that restricts user actions. For example, users can easily bypass a policy by typing the script contents at the command line when they cannot run a script. Instead, the execution policy helps users to set basic rules and prevents them from violating them unintentionally.
Enforcement of these policies only occurs on Windows platforms. The PowerShell execution policies are as follows:
Execution Policy | Description |
---|---|
AllSigned |
|
Bypass |
|
Default |
|
RemoteSigned |
|
Restricted |
|
Undefinded |
|
Unrestricted |
|
You can set an execution policy that is effective only in a particular scope.
The valid values for Scope are MachinePolicy, UserPolicy, Process, CurrentUser, and LocalMachine. LocalMachine is the default when setting an execution policy.
The Scope values are listed in precedence order. The policy that takes precedence is effective in the current session, even if a more restrictive policy was set at a lower level of precedence.
Scope | Description |
---|---|
MachinePolicy | Set by a Group Policy for all users of the computer. Computer Configuration > Administrative Templates > Windows Components > Windows PowerShell > "Turn on Script Execution" |
UserPolicy | Set by a Group Policy for the current user of the computer. User Configuration > Administrative Templates > Windows Components > Windows PowerShell > "Turn on Script Execution" |
Process | The Process scope only affects the current PowerShell session. The execution policy is saved in the environment variable $env:PSExecutionPolicyPreference , rather than the registry. When the PowerShell session is closed, the variable and value are deleted. |
CurrentUser | The execution policy affects only the current user. It's stored in the HKEY_CURRENT_USER registry subkey. |
LocalMachine | The execution policy affects all users on the current computer. It's stored in the HKEY_LOCAL_MACHINE registry subkey. |
Reference:

about_Execution_Policies - PowerShell
If you set the execution policy for the scopes LocalMachine or the CurrentUser, the change is saved in the registry and remains effective until you change it again.
If you set the execution policy for the Process scope, it's not saved in the registry. The execution policy is retained until the current process and any child processes are closed.
- Option One: See All Current PowerShell Script Execution Policies
- Option Two: Set PowerShell Script Execution Policy to "RemoteSigned" or "Restricted" for Current User in Settings
- Option Three: Set PowerShell Script Execution Policy for Current User in PowerShell
- Option Four: Set PowerShell Script Execution Policy for Current User using REG file
- Option Five: Set PowerShell Script Execution Policy for Local Machine in PowerShell
- Option Six: Set PowerShell Script Execution Policy for Local Machine using REG file
- Option Seven: Set PowerShell Script Execution Policy for Process in PowerShell
1 Open Windows Terminal, and select Windows PowerShell.
2 Copy and paste the command below into Windows Terminal, and press Enter. (see screenshot below)
Get-ExecutionPolicy -List
3 You will now see all execution policies listed in precedence order.
Set PowerShell Script Execution Policy to "RemoteSigned" or "Restricted" for Current User in Settings
1 Open Settings (Win+I).
2 Perform an available action below. (see screenshots below)
- Click/tap on System on the left side, and click/tap on For developers on the right side.
- Click/tap on System on the left side, and click/tap on Advanced on the right side.
Starting with Windows 11 build 26120.4151 (Beta 24H2) and build 26200.5603 (Dev 24H2), the For developers page has been redesigned as the Advanced page.
3 Click/tap on PowerShell to expand it open. (see screenshot below step 4)
4 Turn On (RemoteSigned) or Off (default - Restricted) Change execution policy to allow local PowerShell scripts to run without signing. Require signing for remote scripts for what you want. (see screenshot below)
5 You can now close Settings if you like.
1 Open Windows Terminal, and select Windows PowerShell.
2 Copy and paste the command below for the execution policy your want to set into Windows Terminal, and press Enter. (see screenshot below)
Set-ExecutionPolicy AllSigned -Scope CurrentUser -Force
Set-ExecutionPolicy Bypass -Scope CurrentUser -Force
Set-ExecutionPolicy Default -Scope CurrentUser -Force
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
Set-ExecutionPolicy Restricted -Scope CurrentUser -Force
Set-ExecutionPolicy Undefined -Scope CurrentUser -Force
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
3 You can now close Windows Terminal if you like.
1 Do step 2 (Restricted), step 3 (AllSigned), step 4 (RemoteSigned), step 5 (Unrestricted), step 6 (Bypass), or step 7 (Undefined) below for what you would like to do.
(Contents of REG file for reference)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"="Restricted"
(Contents of REG file for reference)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"="AllSigned"
(Contents of REG file for reference)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"="RemoteSigned"
(Contents of REG file for reference)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"="Unrestricted"
(Contents of REG file for reference)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"="Bypass"
This is the default setting.
(Contents of REG file for reference)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"=-
8 Save the .reg file to your desktop.
9 Double click/tap on the downloaded .reg file to merge it.
10 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.
11 You can now delete the downloaded .reg file if you like.
You must be signed in as an administrator to use this option.
If you get a message in red like below when setting a PowerShell execution policy, then it just means that your (current user) set execution policy will be used instead of this local machine setting. If you like, you can set your (current user) execution policy to Undefined to no longer see this message in red when setting the local machine policy.
1 Open Windows Terminal (Admin), and select Windows PowerShell.
2 Copy and paste the command below for the execution policy your want to set into Windows Terminal, and press Enter. (see screenshot below)
Set-ExecutionPolicy AllSigned -Scope LocalMachine -Force
Set-ExecutionPolicy Bypass -Scope LocalMachine -Force
Set-ExecutionPolicy Default -Scope LocalMachine -Force
Set-ExecutionPolicy RemoteSigned -Scope LocalMachine -Force
Set-ExecutionPolicy Restricted -Scope LocalMachine -Force
Set-ExecutionPolicy Undefined -Scope LocalMachine -Force
Set-ExecutionPolicy Unrestricted -Scope LocalMachine -Force
3 You can now close Windows Terminal (Admin) if you like.
1 Do step 2 (Restricted), step 3 (AllSigned), step 4 (RemoteSigned), step 5 (Unrestricted), step 6 (Bypass), or step 7 (Undefined) below for what you would like to do.
(Contents of REG file for reference)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"="Restricted"
(Contents of REG file for reference)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"="AllSigned"
(Contents of REG file for reference)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"="RemoteSigned"
(Contents of REG file for reference)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"="Unrestricted"
(Contents of REG file for reference)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"="Bypass"
This is the default setting.
(Contents of REG file for reference)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"=-
8 Save the .reg file to your desktop.
9 Double click/tap on the downloaded .reg file to merge it.
10 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.
11 You can now delete the downloaded .reg file if you like.
The execution policy set using this option only affects the current PowerShell session for the current process until you close the current PowerShell window.
1 Open Windows Terminal, and select Windows PowerShell.
2 Copy and paste the command below for the execution policy your want to set into Windows Terminal, and press Enter. (see screenshot below)
Set-ExecutionPolicy AllSigned -Scope Process -Force
Set-ExecutionPolicy Bypass -Scope Process -Force
Set-ExecutionPolicy Default -Scope Process -Force
Set-ExecutionPolicy RemoteSigned -Scope Process -Force
Set-ExecutionPolicy Restricted -Scope Process -Force
Set-ExecutionPolicy Undefined -Scope Process -Force
Set-ExecutionPolicy Unrestricted -Scope Process -Force
3 You can now close Windows Terminal if you like.
That's it,
Shawn Brink
Attachments
-
CurrentUser_AllSigned_PowerShell_ExcutionPolicy.reg650 bytes · Views: 341
-
CurrentUser_Bypass_PowerShell_ExcutionPolicy.reg640 bytes · Views: 310
-
CurrentUser_RemoteSigned_PowerShell_ExcutionPolicy.reg652 bytes · Views: 302
-
CurrentUser_Restricted_PowerShell_ExcutionPolicy.reg648 bytes · Views: 359
-
CurrentUser_Undefined_PowerShell_ExcutionPolicy.reg630 bytes · Views: 260
-
CurrentUser_Unrestricted_PowerShell_ExcutionPolicy.reg652 bytes · Views: 394
-
LocalMachine_AllSigned_PowerShell_ExcutionPolicy.reg652 bytes · Views: 238
-
LocalMachine_Bypass_PowerShell_ExcutionPolicy.reg642 bytes · Views: 269
-
LocalMachine_RemoteSigned_PowerShell_ExcutionPolicy.reg654 bytes · Views: 263
-
LocalMachine_Restricted_PowerShell_ExcutionPolicy.reg654 bytes · Views: 255
-
LocalMachine_Undefined_PowerShell_ExcutionPolicy.reg632 bytes · Views: 270
-
LocalMachine_Unrestricted_PowerShell_ExcutionPolicy.reg654 bytes · Views: 303