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
- Run PowerShell elevated as administrator
- Run this PowerShell command syntax:
Update-Help -Force -Ea 0 -Ev what $what.Exception
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.
-
ErrorAction
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.
ErrorVariable
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.
-