When I have multiple versions of a module installed and I try to Update-Help
for just a specific version, it tries to update all versions of the module. If any of the versions fail to update, Update-Help returns an error. The error doesn't include information about the version it was updating that failed.
Questions: Why does it try to update version 1.4, when I specifically ask it to update 1.2? Why doesn't the error include more details, like the version that failed? Or the URI?
(So, I just thought to try adding -Verbose
. Update-help prints some more useful information then - showing that it is updating other versions).
I have several versions of my Powershell module and installed and included in PSModulePath.
I'm developing version 1.4
For dynamic help I have valid URIs for versions 1.0, 1.1, 1.2 and 1.3.
Help for Version 1.4 doesn't exist on the server yet.
When I try to update-help, even for a specific version, Update-Help fails:
C:\> Update-Help -FullyQualifiedModule @{ModuleName = "MyFancyMod"; ModuleVersion = "1.2.0" }
Update-Help : Failed to update Help for the module(s) 'MyFancyMod' 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 -FullyQualifiedModule @{ModuleName = "MyFancyMod ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Update-Help], Exception
+ FullyQualifiedErrorId : UnableToConnect,Microsoft.PowerShell.Commands.UpdateHelpCommand
It actually does update help for 1.2.0, but it also tries to update help for the other versions too.
Using Fiddler to network watch traffic I see it look for help for version 1.0, 1.1, 1.2, 1.3 and 1.4.
Get-Module -ListAvailable MyFancyMod | select name, version, path
Name Version Path
---- ------- ----
MyFancyMod 1.0.1 C:\Program Files\MyProduct\PowerShell\Modules\MyFancyMod1.0.1\MyFancyMod\MyFancyMod.psd1
MyFancyMod 1.1.0 C:\Program Files\MyProduct\PowerShell\Modules\MyFancyMod1.1.0\MyFancyMod\MyFancyMod.psd1
MyFancyMod 1.2.0 C:\Program Files\MyProduct\PowerShell\Modules\MyFancyMod1.2.0\MyFancyMod\MyFancyMod.psd1
MyFancyMod 1.3.0 C:\Program Files\MyProduct\PowerShell\Modules\MyFancyMod1.3.0\MyFancyMod\MyFancyMod.psd1
MyFancyMod 1.4.0 C:\Program Files\MyProduct\PowerShell\Modules\MyFancyMod1.4.0\MyFancyMod\MyFancyMod.psd1