Help! save-help for totally offline PC (PS newbie)

I thought this would be easy.
I want to Save-Help for an offline PC (no internet or network) that has PS 7.4.5,
using an online PC (internet access) that has PS 4.5.1. Both are Windows 11.
I want to save help for all modules, onto a thumb drive, to install on the offline PC.

On the offline PC I ran

Export-Clixml  -inputObject PSModuleInfo  - Path D:\Exported.xml`

(where D: is the thumb drive), and it produced this xml file:

<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
  <S>PSModuleInfo</S>
</Objs>

… then attached that to the online PC and ran these 2 commands (from a save-Help example), which produced the error below:

PS C:\Windows\system32> $deserialized_m = Import-CliXml "D:\Exported.xml"
PS C:\Windows\system32> Save-Help -Module $deserialized_m -DestinationPath "D:\!PSHelpSaved"
Save-Help : No Windows PowerShell modules were found that match the following pattern: PSModuleInfo. Verify the pattern and then try the command again.
At line:1 char:1
+ Save-Help -Module $deserialized_m -DestinationPath "D:\!PSHelpSaved"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (PSModuleInfo:String) [Save-Help], Exception
    + FullyQualifiedErrorId : ModuleNotFound,Microsoft.PowerShell.Commands.SaveHelpCommand

What am I missing?

Thanks for any tips!

Hi, welcome to the forum! Where did you get the idea this would do what you’re wanting to do? This is just exporting the string PSModuleInfo. I would take a look at Save-Module and check out this link

Hi krzydoug, thanks for replying.

I got it from
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/save-help?view=powershell-7.4
which says

“… It is also possible to save a PSModuleInfo object to disk or removable media by running Export-Clixml on a computer that does not have Internet access, import the object on a computer that does have Internet access, and then run Save-Help on the PSModuleInfo object. The saved help can be transported to the remote computer by using removable storage media, such as a USB drive. The help can be installed on the remote computer by running Update-Help. This process can be used to install help on computers that do not have any kind of network access.”

The specific steps were from a microsoft support page or maybe from running get-Help save-Help -examples, I don’t remember, anyway I was trying the 2nd part, “import the object on a computer that does have internet access”.

I checked out your link. Interesting, but it seems to be for PCs with no internet but do have network access, which i don’t have. Thanks, though.

From the XML file it looks like you didn’t run Get-Module so you haven’t exported the required info. You have, as @krzydoug pointed out, just exported the the string ‘PSModuleInfo’.

The help file gives the following example for the export:

$m = Get-Module -Name "DhcpServer" -ListAvailable
Export-CliXml -Path "E:\UsbFlashDrive\DhcpModule.xml" -InputObject $m

Hi matt-bloomfield. Thanks for replying. What info needs to be in the xml file, when you need help for all modules, not one in particular? I had just downloaded ps 7.4.5 to a thumb drive and installed it on the offline PC, but it has essentially no help available, so I need everything. Would Get-Module to do that? Sorry, I’m totally clueless with PS, and can’t find clear answers on Microsoft.com.

I thought the Export-CliXml would produce a file that simply identifies which PS version the offline PC has, and other commands on the online PC would tell it to save-Help for everything for that version. Wish there were a way to just say “get me all help for PS 7.4.5” …

(All I’m trying to do is update a Win 11 installation image with the latest Defender and LCU before taking a new PC online. A year ago it was simple to do that using cmd commands, but now Microsoft seems to require using PS, which is a real challenge when you don’t know PS to begin with and can’t get the help files to learn it… Sorry for the rant)

I’ve never done this, so I’m not sure if/how well it works.

The example given in the help is just for a single module, so if you want to do all available modules, just omit the module name. That should give you an XML file that contains the info. you need.

$m = Get-Module -ListAvailable
Export-CliXml -Path "E:\UsbFlashDrive\AllModules.xml" -InputObject $m

Unless the online PC is completely clean, I would except you’ll be exporting information for modules that don’t exist on the offline computer, so expect you may still get some errors.

Thank you matt-bloomfield, that worked! Generated a large xml file >6MB.
On the online machine I did these commands:

$deserialized_m = Import-CliXml "D:\!!PSExported\Exported2.xml"
Save-Help -Module $deserialized_m -DestinationPath "D:\!PSHelpSaved"

and as you suspected it produced errors for modules that don’t support updatable help,
and a few others I’m investigating but all in all, a big success. THANK YOU

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.