I tried this:
Install from PowerShellGallery (preferred)
You will need the 1.6.0
or a higher version of PowerShellGet
to install the latest prerelease version of PSReadLine
.
Windows PowerShell 5.1 ships an older version of PowerShellGet
which doesn’t support installing prerelease modules, so Windows PowerShell users need to install the latest PowerShellGet
(if not yet) by running the following commands from an elevated Windows PowerShell session:
Install-Module -Name PowerShellGet -Force Exit
After installing PowerShellGet
, you can get the latest prerelease version of PSReadLine
by running
Install-Module PSReadLine -AllowPrerelease -Force
If you only want to get the latest stable version, run:
Install-Module PSReadLine
At the end I’ve found the “solution”
I downloaded PSReadLine manually from here:
After unzipping I was able to install it with:
install-module /path/to/module.psd1
But I have to type it every time after launching pwsh
I tried to copy files from the archive to:
/opt/microsoft/powershell/7/Modules
And then load module by install-module psreadline ← didn’t work
Ther error message is always the same:
install-module: The term 'install-module' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
And when I list modules I get:
PS /home/jm> get-module -listavailable
Directory: /opt/microsoft/powershell/7/Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Manifest 7.0.0.0 Microsoft.PowerShell.Host Core {Start-Transcript, Stop-Transcript}
Manifest 7.0.0.0 Microsoft.PowerShell.Management Core {Add-Content, Clear-Content, Clear-Item…
Manifest 7.0.0.0 Microsoft.PowerShell.Security Core {Get-Credential, Get-ExecutionPolicy, S…
Manifest 7.0.0.0 Microsoft.PowerShell.Utility Core {Export-Alias, Get-Alias, Import-Alias,…