permalink: spells/bypass-the-powershell-execution-policy
tags:
- Application/PowerShell
- OS/Windows
- HowTo
- AttackCycle/ExploitationThe PowerShell execution policy can be bypassed on a case-by-case basis using -ex bypass; for example:
powershell -ex bypass -File $FILE.ps1
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!