The method of launching PowerShell scripts from Far Manager I have described previously has 2 important drawbacks:
- You can’t pass arguments to the script, and
- You can’t launch script in a separate window
Here’s how to fix this:
- Start regedit, open HKCR\Microsoft.PowerShellScript.1\shell\Open\command key
- Set it to
"C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe" "-file" "%1" %*
Now you can press Shift+Enter to start PowerShell script in a new window.
As a bonus, you can now double-click .ps1 files in Windows Explorer to launch them. Why is this not a default behaviour? Most likely Microsoft decided to be extra cautious here.
Make sure you have Powershell version 2.0 or higher for this to work. How to check Powershell version.