How to run PowerShell scripts from Far Manager

Let’s say you use Far Manager and want to launch PowerShell script. With default installation pressing Enter on PowerShell script in Far Manager will open the script in Notepad. Not very helpful.

Here’s how to configure Far Manager to launch PowerShell script by pressing Enter key:

  1. Open Commands menu, select File associations.
  2. Press Ins key to add new association.
  3. Enter *.ps1 as file mask.
  4. Enter the following as execute command:
    powershell.exe -file "!.!"

Bonus: how to change colour of PowerShell scripts to green:

  1. Open Options menu, select Files highlighting.
  2. Locate *.exe,*.com,*.bat entry, press Enter to edit.
  3. Add *.ps1 to the list, select Ok to save.

See also: Running Windows PowerShell Scripts

Update: there is an enhancement that allows passing arguments to the script and launch script in a separate window.