Launching a PowerShell Script Externally

by Mar 8, 2010

To launch a PowerShell script outside of the PowerShell console (i.e. as scheduled task or as a link), prepend the script path with this:

Powershell.exe -noprofile -executionpolicy Bypass c:\pathtoscript.ps1

As you can see, in v.2 Microsoft added an -executionPolicy parameter, which allows you to override whatever execution policy is set by default. However, your call cannot override this setting if the execution policy was defined by a group policy.

Twitter This Tip! ReTweet this Tip!