Set Powershell as the default shell of Far Manager?
Can I set Powershell as the default shell of Far Manager?
Solution 1:
With PowerShellFar in Far Manager you can invoke PowerShell commands right from
the command line with the prefix ps:
. That is:
Commands with console output, prefix ps:
ps: Get-Date
ps: 3.14 / 3
ps: [math]::pi / 3
Commands with viewer output, prefix vps:
vps: Get-Process
vps: Get-ChildItem C:\TEMP\LargeFolder -Recurse -Force
Commands starting UI or background jobs normally use prefix ps:
ps: $Far.Msg("Hello world!")
ps: Get-Process | Out-FarList -Text Name | Open-FarPanel
ps: Start-FarJob { Remove-Item C:\TEMP\LargeFolder -Recurse -Force }
If you expect lengthy output consider to start Far Manager as Far.exe /w
.
Finally see built-in PowerShellFar help, sections Command line
and FAQ
. You
can define some accelerators. For example I use [Space]
which inserts ps:
into the empty command line. Thus, actually I have to type just 1 more symbol.
This is a little bit inconvenient but it is perfectly compensated by the
standard CMD shell at hands, CMD is not dead, especially in Far Manager.
Solution 2:
PowerShellFar allows you to integrate PowerShell into Far Manager.
PowerShellFar combines the rich console based user interface of Far Manager with full power of Windows PowerShell perfectly integrated into this original text friendly environment.
Solution 3:
An option that has not been mentioned so far (and it is not so great because out of the box, there is no auto completion), but you can enter
far:config
and scroll down until you find this setting:
System.Executor.Comspec │string │%COMSPEC%
System.Executor.ComspecArguments │string │/S /C "{0}"
You can change it like so:
System.Executor.Comspec │string │powershell
System.Executor.ComspecArguments │string │-c "{0}"
This will allow you to run PowerShell commands directly from the FAR shell.