14

Updating help for the PSReadLine module in Windows PowerShell 5.1

 4 years ago
source link: https://devblogs.microsoft.com/powershell/updating-help-for-the-psreadline-module-in-windows-powershell-5-1/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Updating help for the PSReadLine module in Windows PowerShell 5.1

Updating help for the PSReadLine module in Windows PowerShell 5.1

Avatar

March 11th, 2021

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 a capital 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.

  1. Close all powershell.exe processes. Then rename the PSReadline module folder name to PSReadLine.
  2. Open an powershell.exe session in Administrator privilege.
  3. Run Remove-Module PSReadLine to remove the auto-loaded PSReadLine module.
  4. Run Import-Module PSReadLine (use PSReadLine with capital L).
  5. 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.

Sean Wheeler

Sr. Content Developer for PowerShell, Microsoft Developer Relations | Content + Learning

Follow


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK