Launching Scripts Externally

by Jan 27, 2011

For example, you should use this line if you want to launch a *.ps1 PowerShell script externally from outside PowerShell via desktop shortcut or from inside a batch file:

powershell.exe -nologo -executionpolicy bypass -noprofile -file "C:\myscript.ps1"

Use this to simply execute a PowerShell command:

powershell.exe -nologo -noprofile -command Get-Process

Twitter This Tip!
ReTweet this Tip!