Friday, May 3, 2013

Creating a shortcut for a PowerShell script

By default, Notepad is used when double-clicking on a .ps1 PowerShell script.  To get around this issue, create a new shortcut and use the following parameters.  This method does not require the modification of the execution policy.

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\users\username\desktop\script.ps1"

No comments:

Post a Comment