我正在尝试下载并安装所有命令的帮助文件,但它不起作用。我在 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。
这正是输出的样子
问题在于 PSReadline 的大小写,在 PowerShell 6 中更改为 PSReadLine。
修复很简单:
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/
解决了,感谢我在 stackoverflow 上找到的另一篇文章。 根据此 Microsoft 论坛,以下命令应该绕过任何错误并让您成功运行 cmdlet
Update-Help
Update-Help -Verbose -Force -ErrorAction SilentlyContinue
它解决了我的 Update-Help -Verbose -Force -ErrorAction SilentlyContinue powershell version 5.1.0