Config Server Firewall

How to Set PowerShell Execution Policy in Windows 10 & 11

The PowerShell execution policy is a security measure that determines whether scripts have permission to run on Windows computers. By default, the execution policy for Windows PowerShell is set to Restricted on Windows 10, 11, and Windows Server.

This means you cannot execute scripts, but you can still run individual commands in the PowerShell window. If you create a script and try to run it, you’ll receive an error message similar to the following:

hello.ps1 cannot be loaded because running scripts is disabled on this system.

To check the current PowerShell execution policy setting, you can use the following command:

Get-ExecutionPolicy

You can change the execution policy setting using the Set-ExecutionPolicy command:

Set-ExecutionPolicy Bypass CurrentUser

In the previous example, we set the execution policy to Bypass, allowing the script to run without any restrictions.

The following are the possible values for the execution policy in Windows PowerShell:

Set PowerShell Execution Policy

In this tutorial, we focused on allowing scripts to run on Windows 10 and Windows 11 by setting the execution policy to Bypass. However, there’s much more to discover about PowerShell execution policies. If you’d like to dive deeper, click on this link.