10

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.

Vomit IT - Chunky Mess Style
  • 40,038
  • 27
  • 84
  • 117
SirTechSpec
  • 295
  • 2
  • 9
  • I accepted postanote's answer as the most useful - the commands you mentioned didn't give me any more info than the error messages I got while running update-help normally. – SirTechSpec Jan 24 '18 at 16:20
  • IF the error was that I wasn't running Powershell as an admin and therefore couldn't update the help, then your answer would be useful. But that wasn't the error, because I already was running as amin, and when I followed the steps you outlined, it literally just repeated the errors that I pasted into the question, with no additional details. I am looking for "a technical solution, why, how to resolve, etc.", but you have not provided it (at least not yet.) – SirTechSpec Jan 24 '18 at 18:49

4 Answers4

5

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

Vomit IT - Chunky Mess Style
  • 40,038
  • 27
  • 84
  • 117
  • 1
    So it looks like you are instructing Powershell to take no action if updating the help fails, and you are storing the error information in a variable called $what Thank you – joshgoldeneagle Apr 03 '19 at 16:50
2

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.

postanote
  • 4,589
  • 2
  • 7
  • 7
1

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
Altered-Ego
  • 252
  • 2
  • 7
-1

Better use:

$modules = Get-Module -ListAvailable

foreach ($module in $modules) {
    Write-Output $module
    Update-Help -Module $module -ErrorAction Continue
}
Wilco
  • 1
  • 3
    Welcome to Super User. Can you please [edit] your answer to explain what it does and how you envision it solving the OP's problem? – I say Reinstate Monica Sep 15 '18 at 03:52
  • 2
    Welcome to superuser: This may answer the question (an answer has been accepted so would work for the OP) You have to explain with detail why it will work and work better. Please take a couple of minutes and read:- [answer], again welcome to superuser.Thankyou – mic84 Sep 15 '18 at 07:15
  • This tries to do updates for modules that don't support updatable help, resulting in way more errors than the 1 OP was getting. – THE JOATMON Apr 29 '19 at 20:43