I need to set default application for any powershell files as C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe using a powershell script. For that purpose I have written the following code -
cmd.exe /c assoc .ps1=
cmd.exe /c ftype myext="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
cmd.exe /c assoc .ps1=myext
Now, when I double click any .ps1 files, it opens a blank powershell window.
Can anyone please help me regarding this ?
Thanks!