So I have successfully bound a key to open this script:
But the way to run that script with PowerShell is to right-click it and go Open with PowerShell
. Using the key binding, it just opens it normally (so with notepad).
How can I make it so it opens with PowerShell from that binding?
You already have a lnk
that points to your script file. Make that point to PowerShell and pass your file as a parameter. Assuming your file is located in C:\PSScripts
you would have to set the Target of the lnk
to
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command "& C:\PSScripts\Display Off.ps1" -NoLogo -NonInteractive -NoProfile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With