Updating help for the PSReadLine module in Windows PowerShell 5.1
Back in November of 2020 I posted instructions about how to work around the problem of updating the help for the PSReadLine module.
The version of the PSReadline module that shipped in Windows PowerShell 5.1 used a lowercase
letter in the name. The name of the module was changed for the release of PowerShell 6. It now uses
L in the name. And even after following the instructions in the previous post, you still
get the same error when you try to update help for Windows PowerShell 5.1.
Failed to update Help for the module(s) ‘PSReadline‘
The root problem in Windows PowerShell 5.1 is that the module is automatically loaded at startup
using the PSReadline name (with the lowercase
l). Use the following steps workaround this
problem and update the help.
- Close all
powershell.exeprocesses. Then rename the PSReadline module folder name to PSReadLine.
- Open an
powershell.exesession in Administrator privilege.
Remove-Module PSReadLineto remove the auto-loaded PSReadLine module.
Import-Module PSReadLine(use PSReadLine with capital
- Then run
Update-Help -Module PSReadLine -Force
These steps load the module in your session using the new name, which allows
Update-Help to use the
correct name to find the help content.