icon

PowerShell ExecutionPolicy Bypass

Last modified: 2024-08-28

Method 1. Set-ExecutionPolicy

By default, the ExecutionPolicy is set to Restricted.

Get-ExecutionPolicy
# Restricted

To bypass the restriction, run one of the following commands as Administrator privilege:

Set-ExecutionPolicy Unrestricted
Set-ExecutionPolicy Bypass

Method 2. Run with -ExecutionPolicy Bypass

powershell -noexit -ExecutionPolicy Bypass -File example.ps1