2

I want to be able to double click a powershell script and it to open in powershell instead of notepad. Can I do that?

To run powershell scripts from the file you right-click the script then click run with powershell, can I make it so that double-clicking the script defaults to opening the script in powershell?

Nikola Johnson
  • 479
  • 1
  • 4
  • 11

1 Answers1

1

Use

ftype Microsoft.PowerShellScript.1="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "%1"

In administrator cmd. Ftype changes double-click behavior of certain filetypes specified by the assoc cmd command.

Nico Nekoru
  • 2,840
  • 2
  • 17
  • 38