Wednesday, 15 February 2012

Bypass powershell execution policy

I was given this information by a collague but have not tested this as yet.

Bypassing Execution Policy for Powershell
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 -

No comments:

Post a Comment