Update-help fails to update two modules

On my computer (Win10 Enterprise x64, 1709) running Update-Help returns two errors:

update-help : Failed to update Help for the module(s) 'AutoSequencer, 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.

At line:1 char:1 + update-help + ~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (:) [Update-Help], Exception + FullyQualifiedErrorId : UnableToRetrieveHelpInfoXml,Microsoft.PowerShell.Commands.UpdateHelpCommand

update-help : Failed to update Help for the module(s) 'PrintManagement' 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.

At line:1 char:1 + update-help + ~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Update-Help], Exception + FullyQualifiedErrorId : UnableToConnect,Microsoft.PowerShell.Commands.UpdateHelpCommand

This is a problem because I'm scripting windows updates for the first time and having the help files for WindowsUpdateProvider is kind of important. Even if I knew how to find and fix the "HelpInfoUri" property, I wouldn't know what to set it to - a Google search for "WindowsUpdateProvider help" mostly returns people asking about this problem in various languages, with no solutions I can see. This likewise means I can't work around the problem by using online help. (Get-Help WindowsUpdateProvider -online returns a similar error.)

I am aware of the "PSWindowsUpdate" module but due to our processes, using a module that ships with Windows 10 would be preferable.


Solution 1:

This is not unusual. It has happen to me many times. Since the first release of PowerShell/Monad.

So, don't stress over this, because you normally can't fix it (many times only the author can), and use the online web help version for the module that have issues, if there is any of course.

Not all modules have updatable help, or there are issues with the associated manifest, help links files.

So, as noted by the PimpJuiceIT, just use that command to ignore the error.

Solution 2:

I stumbled upon the Failed to update Help for the module(s)~ TechNet post after trying this and getting the exact same result as you.

After running with the syntax below once I read over that post before I elevated the PowerShell prompt, this gave me the needed detail of what the issue was and how to resolve.

Two Part Solution

  1. Run PowerShell elevated as administrator
  2. Run this PowerShell command syntax:

    Update-Help  -Force -Ea 0 -Ev what
    $what.Exception
    

    source


The Error (using -ErrorAction [-Ea] and -ErrorVariable [-Ev])

  • Failed to update Help for the module(s) : '<List of Modules>~' Access is denied. The command could not update Help topics for the Windows PowerShell core modules, or for any modules in the $pshome\Modules directory. To update these Help topics, start Windows PowerShell by using the "Run as Administrator" command, and try running Update-Help again. Failed to update Help for the module(s) ~


Further Resources

  • Update-Help
  • Common Parameters

    • ErrorAction

      • The -ErrorAction common parameter allows you to specify which action to take if a command fails. The available options are: Stop, Continue, SilentlyContinue, Ignore, or Inquire. If you’re developing a Windows PowerShell workflow, you can also use the Suspend value. However, advanced functions cannot be suspended.

        When you specify the ErrorAction parameter during a call to a command, the specified behavior will override the $ErrorActionPreference variable in Windows PowerShell. This variable is part of a handful of variables known as “preference variables.” By default, Windows PowerShell uses an error action preference of Continue, which means that errors will be written out to the host, but the script will continue to execute.

        source

    • ErrorVariable

      • Normally, if you run a Windows PowerShell command and an error occurs, the error record will be appended to the “automatic variable” named $error. When you use the -ErrorVariable parameter in a call to a command, the error is assigned to the variable name that you specify. It’s important to note that even when you use the -ErrorVariable parameter, the $error variable is still updated.

        source

Solution 3:

Quoting dsolodow, issue #139 from the PowerShell docs on GitHub:

No, there isn't a fix for the missing help yet. However, most of the cmdlets in this module don't have any real options and just return a true/false or a date time.

I personally like the workaround below which carries on running and doesn't stop on the error, but give you the errors at the end. It was suggested by Alo Press in this Technet discussion.

Update-Help  -Force -Ea 0 -Ev what
$what.Exception