Cardboard Iguana Security

Bypass the PowerShell execution policy

The PowerShell execution policy can be bypassed on a case-by-case basis using -ex bypass; for example:

powershell -ex bypass -File $FILE.ps1
Tip

The -ex bypass flag isn't necessary when executing code directly with -c.

This can also be set temporarily within a shell:

Set-ExecutionPolicy Bypass -Scope process -Force

However, this will not bypass other protections, in particular AMSI!

Bypass the PowerShell execution policy
Interactive graph
On this page
Bypass the PowerShell execution policy