powershell 更新帮助失败

标签 powershell powershell-v5.1

我刚刚开始从 Microsoft 虚拟学院学习 PowerShell,并且正在运行指定的命令之一。而在他们的一端,它起作用了,而我的却没有。我确实四处寻找解决这个问题的方法。我只是不知道出了什么问题。任何提示都会对 PowerShell 新学习者有所帮助。

PS C:\Windows\system32> Update-Help -Force
Update-Help : Failed to update Help for the module(s) 'WindowsUpdateProvider' with UI culture(s) {en-US} : Unable to retrieve the HelpInfo XML file for UI culture en-US. Make sure the
HelpInfoUri property in the module manifest is valid or check your network connection and then try the command again.
At line:1 char:1
+ Update-Help -Force
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [Update-Help], Exception
    + FullyQualifiedErrorId : UnableToRetrieveHelpInfoXml,Microsoft.PowerShell.Commands.UpdateHelpCommand

PS C:\Windows\system32> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17134.228
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17134.228
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

最佳答案

同意,这应该是一个 super 用户帖子,但既然它就在这里。

这种错误很常见,并且在大多数情况下都是预料之中的。

由于各种原因,并非所有帮助文件都会按预期更新,大多数时候都是与关联的更新链接有关。如您的错误消息所示。

许多模块要么没有在线可更新的帮助,要么 URL 已被删除。

可以安全地忽略这些类型的错误。它们不会影响 PS 功能或使用。

Get-Module -ListAvailable | Where HelpInfoUri | Update-Help

或者,如果您想查看所有与此相关的消息,请执行...

Update-Help -Force -Verbose -ErrorAction SilentlyContinue

# Results

VERBOSE: Resolving URI: "http://go.microsoft.com/fwlink/?linkid=390758"
VERBOSE: Your connection has been redirected to the following URI: "http://download.microsoft.com/download/0/1/C/01CCC594-2F13-40E8-98FE-185486228BF4/"
VERBOSE: Performing the operation "Update-Help" on target "CimCmdlets, Current Version: 5.0.0.0, Available Version: 5.0.0.0, UICulture: en-US".

如果您想以更易于理解的方式查看完整的错误消息,请执行以下操作...

Update-Help -Force -Ea 0 -Ev ErrMsgDetail
$ErrorMsgDetail.Exception

Failed to update Help for the module(s) 'AnyBox' with UI culture(s) {en-US} : Unable to connect to Help content. The server on which Help content is stored might not be available. 
Verify that the server is available, or wait until the server is back online, and then try the command again.

Failed to update Help for the module(s) 'HostNetworkingService, WindowsUpdateProvider' with UI culture(s) {en-US} : Unable to retrieve the HelpInfo XML file for UI culture en-US. 
Make sure the HelpInfoUri property in the module manifest is valid or check your network connection and then try the command again.

关于powershell 更新帮助失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52749398/

相关文章:

powershell - Copy-Item:找不到与参数名称 'FromSession'匹配的参数

powershell - 延迟忽略CTRL + C-Powershell

powershell - Get-ChildItem,通配符和过滤

iis - 使用 Powershell 在不是应用程序的文件夹中创建 Web 应用程序

powershell - 将目录中一种类型的所有文件复制到一个文件夹中

xml - 使用 Excel VBS 解析 PowerShell PSCustomObject XML

xml - 使用 PowerShell 加载 XML 字符串

sorting - powershell:import-csv | get-member:基于(原始)位置对列名称/属性名称进行排序。重命名大学名?

powershell - 如何在对象中搜索值?

powershell - 传递给 Invoke-Command 的属性将类型从 IDictionary 更改为 HashTable