Monday 9 July 2012

Execution Policy

While a necessary evil, Execution Policy can sometimes be a pain.

Here's a couple of alternatives to setting the execution policy to Unrestricted:

Powershell.exe noprofile executionpolicy bypass file "C:\Scripts\myScript.ps1"

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

(The minus (-) is important!)

No comments:

Post a Comment