Bypassing Execution Policy

by Nov 4, 2011

When execution policy prevents execution of PowerShell scripts, you can still execute them. There is a secret parameter called “-” . When you use it, you can pipe a script into powershell.exe and execute it line by line:

Get-Content 'C:\somescript.ps1' | powershell.exe -noprofile -

Twitter This Tip!
ReTweet this Tip!