I would like to open a file using the cmdln in PowerShell with a particular application.
In my case, I have a file scripts.js which I'd like to open in Notepad++ but which would normally open in regular notepad.exe if I did this: Invoke-Item .\scripts.js
What should I do to open that file in Notepad++?
By using Start-Process you can do:
$FileLocation = 'C:\temp\test\scripts.js'
Start-Process notepad++ $FileLocation
                        Use the call operator and pass the file as an argument to the program you want to open it with:
& 'C:\path\to\notepad++.exe' '.\script.js'
                        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