Is there a way to make a PowerShell script work by double clicking a .ps1 file?

Create a shortcut with something like this as the “Target”:

powershell.exe -command "& 'C:\A path with spaces\MyScript.ps1' -MyArguments blah"

Leave a Comment