PowerShell: Save-Help for Modules that Aren’t Installed on the Local Computer

Update-Help and Save-Help are new PowerShell version 3 cmdlets which allow you to initially download PowerShell help and keep the local PowerShell help files updated that are installed on your computer and available via the Get-Help cmdlet.

In PowerShell version 3, Save-Help allows the updated help files to be saved to a location where a machine that doesn’t have Internet access can update it’s help from. The problem is that in order to save help for a module, that module has to exist on the local computer that’s performing the actual download otherwise an error will be generated:

Save-Help : No Windows PowerShell modules were found that match the following pattern: ServerCore. Verify the pattern and then try the command again. At line:1 char:1 + Save-Help -Module ServerCore -DestinationPath \dc01PSHelp -Force +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (ServerCore:String) [Save-Help], Exception + FullyQualifiedErrorId : ModuleNotFound,Microsoft.PowerShell.Commands.SaveHelpCommand

![save-help1.png" height=“133](/images/2012/11/save-help1.png” height=“133)

Now this is definitely unsupported, but what I’ve found is you can copy the module manifest file (.psd1 file) from a machine that has the module installed to the computer you’re going to run the Save-Help cmdlet on to trick it into thinking the module is installed:

![save-help2b.png” height=“155](/images/2012/11/save-help2b.png” height=“155)

So all I’ve done is created a sub folder in my modules directory and place the manifest file in it for the module that’s not installed but that I want to download the help for:

![save-help3.png” height=“247](/images/2012/11/save-help3.png” height=“247)

Once that’s complete, saving the help for that particular module works without issue:

![save-help4.png” height=“41](/images/2012/11/save-help4.png” height=“41)

This flashes by fairly quickly when the help is being downloaded:

![save-help5.png” height=“67](/images/2012/11/save-help5.png” height=“67)

Now the help for that module is located on the network share that it was directed to using the Save-Update cmdlet with the -DestinationPath parameter:

![save-help6.png” height=“164](/images/2012/11/save-help6.png” height=“164)

On a server without an Internet connection, when trying to update the help, you’ll receive the following error:

![save-help7.png” height=“168](/images/2012/11/save-help7.png” height=“168)

When specifying the location using the -SourcePath parameter with Update-Help, the help on this server without an Internet connection completes without issue:

![save-help8.png” height=“100](/images/2012/11/save-help8.png” height=“100)

Now the cool thing about remoting being enabled by default on Windows Server 2012 is you can update the help remotely using the Invoke-Command cmdlet:

![save-help9.png” height=“96](/images/2012/11/save-help9.png” height=“96)

I have a couple of additional ideas about how to save the help for modules that aren’t installed on the local computer so check back on Thursday for part 2 of this blog article.