有人遇到过这个 Powershell“Update-Help”命令吗?

问题描述 投票:0回答:3

我正在尝试下载并安装所有命令的帮助文件,但它不起作用。我在 Windows 终端中使用 Powershell 7.1.1。

Update-Help: Failed to update Help for the module(s) 'ConfigDefender, PSReadline' with UI culture(s) {en-US} : One or more errors occurred. (Response status code does not indicate success: 404 (The specified blob does not exist.).).

美国英语帮助内容可用,可以使用以下方式安装:Update-Help -UICulture en-US。

这正是输出的样子

powershell powershell-7.0
3个回答
11
投票

问题在于 PSReadline 的大小写,在 PowerShell 6 中更改为 PSReadLine。

修复很简单:

  1. 关闭所有 PowerShell 窗口
  2. 从 TaskMgr 确保终止任何剩余的 PowerShell 进程。
  3. 打开 Admin Cmd 提示符(不是 PowerShell)并运行以下命令:
ren "C:\Program Files\WindowsPowerShell\Modules\PSReadline" PSReadLine
ren "%APPDATA%\Microsoft\Windows\PowerShell\PSReadline" PSReadLine

就是这样。现在您可以关闭 Cmd 提示窗口,打开 PowerShell 窗口并执行正常的 Update-Help。

请参阅此博客了解一些其他背景信息: https://devblogs.microsoft.com/powershell/updating-help-for-the-psreadline-module-in-windows-powershell-5-1/


11
投票

解决了,感谢我在 stackoverflow 上找到的另一篇文章。 根据此 Microsoft 论坛,以下命令应该绕过任何错误并让您成功运行 cmdlet

Update-Help

 Update-Help -Verbose -Force -ErrorAction SilentlyContinue

0
投票

它解决了我的 Update-Help -Verbose -Force -ErrorAction SilentlyContinue powershell version 5.1.0

© www.soinside.com 2019 - 2024. All rights reserved.