Making a Double Clickable PowerShell One Liner

It’s not uncommon for me to need a quick, single focus task to be performed on a Windows machine. The task can often be performed with a PowerShell or cmd one-liner. I do not, however, like to alter my PowerShell execution policy without serious deliberation. Thus, running a script isn’t usually the way to go.

My solution? I use a Windows shortcut that points to the powershell.exe executable, and pass it the -Command option with my simple commands. For example, I frequently have to kill off the parsecd.exe process, so I run this

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command "& taskkill /T /F /fi 'IMAGENAME eq parsecd.exe'"

Leave a Reply

%d bloggers like this: