Skip to content

PowerShell FarNet modules

Roman Kuzmin edited this page Jul 14, 2024 · 1 revision

The following PowerShell modules FarNet.* have dual nature:

They are PowerShell modules that may be used without Far Manager. In this scenario they are installed from PSGallery.

They are also designed to be used in Far Manager by FarNet modules. In this scenario they are installed as FarNet libraries.

Install as FarNet libraries

To install as FarNet library, follow these steps.

E.g. FarNet.Redis is installed to %FARHOME%\FarNet\Lib\FarNet.Redis.

Then in Far Manager the module may be imported as:

Import-Module $env:FARHOME\FarNet\Lib\FarNet.Redis

Expose as symbolic link or junction

Consider exposing this module to PowerShell, so that you can:

Import-Module FarNet.Redis

(1) Choose one of the module directories, see $env:PSModulePath.

(2) Change to the selected directory and create the symbolic link

New-Item FarNet.Redis -ItemType SymbolicLink -Value $env:FARHOME\FarNet\Lib\FarNet.Redis

(3) Alternatively, you may create the similar folder junction point in Far Manager using AltF6.

This is it, the module is now known to PowerShell and may be imported normally. Also, thanks to PowerShell module caching, in some scenarios module commands may be used without explicitly importing the module.

After that you may update the FarNet package with new versions. The symbolic link or junction do not have to be updated, they point to the same location.