Windows PowerShell Help Distribution

Early versions of Windows PowerShell came bundled with detailed help information (i.e. 1.0 and 2.0). In recent versions—3.0 and 4.0—the help information that is initially installed with Windows PowerShell has been trimmed down to reduce the size of the installation footprint on the many servers and workstations on which much or all of the help information may be construed as unnecessary baggage. PowerShell version 3.0 introduced the Update-Help cmdlet to download the extra detailed help information, and Save-Help was included with version 4.0 to allow downloading once, then updating one or many computers offline from that saved saved repository.

Here are some links to articles from Microsoft on Update-Help and Save-Help, one from Thomas Lee on the topic, and two from Mike F. Robbins that might all be helpful.

Update-Help: <>
Save-Help: <>
Thomas Lee: <>
Mike F. Robbins: <> and part 2: <>

In particular, I would recommend reading examples four and five from the Update-Help article. These topics relate to scenarios that people often ask about. I suggest deriving your own update scripts and techniques for how you want to run the updates, however the fundamentals are included in those two parts of Microsoft’s documentation (Update-Help link above). I have taken the liberty of quoting those two examples below. Everything below this paragraph is quoted directly from Microsoft’s Update-Help help topic. I hope this helps. Please let me know of any questions. Good luck!

From: Microsoft’s Update-Help PowerShell help topic.

Example 4: Update help automatically
This command creates a scheduled job that updates help for all modules on the computer every day at 3:00 in the morning.
The command uses the Register-ScheduledJob cmdlet to create a scheduled job that runs an Update-Help command. The command uses the Credential parameter to run the Update-Help cmdlet with the credentials of a member of the Administrators group on the computer. The value of the Trigger parameter is a New-JobTrigger command that creates a job trigger that starts the job every day at 3:00 AM.
To run the Register-ScheduledJob command, start Windows PowerShell with the “Run as administrator” option. When you run the command, Windows PowerShell prompts you for the password of the user specified in the value of the Credential parameter. The credentials are stored with the scheduled job; you are not prompted when the job runs.
You can use the Get-ScheduledJob cmdlet to view the scheduled job, use the Set-ScheduledJob cmdlet to change it, and use the Unregister-ScheduledJob cmdlet to delete it. You can also view and manage the scheduled job in Task Scheduler in the following path: Task Scheduler LibraryMicrosoftWindowsPowerShellScheduledJobs.

Windows PowerShell

PS C:> Register-ScheduledJob -Name UpdateHelpJob -Credential Domain01User01 -ScriptBlock {Update-Help} -Trigger (New-JobTrigger -Daily -At “3 AM”)
Id         Name            JobTriggers     Command                                  Enabled
—         —-            ———–     ——-                                  ——-
1          UpdateHelpJob   1               Update-Help                              True

Example 5: Update help on multiple computers from a file share
These commands download updated help files for system modules from the Internet and save them in file share. Then the commands install the updated help files from the file share on multiple computers. You can use a strategy like the one shown here to update the help files on numerous computers, even those that are behind firewalls or are not connected to the Internet.
All of the commands in this example were run in a Windows PowerShell session that was started with the “Run as administrator” option.

The first command uses the Save-Help cmdlet to download the newest help files for all modules that support Updatable Help. The command saves the downloaded help files in the Server01SharePSHelp file share.
The command uses the Credential parameter of the Save-Help cmdlet to specify the credentials of a user who has permission to access the remote file share. By default, the command does not run with explicit credentials and attempts to access the file share might fail.

Windows PowerShell

PS C:> Save-Help –DestinationPath Server01SharePSHelp -Credential Domain01Admin01

The second command uses the Invoke-Command cmdlet to run Update-Help commands on many computers remotely.
The Invoke-Command command gets the list of computers from the Servers.txt file.
The Update-Help command installs the help files from the file share on all of the remote computers. The remote computer must be able to access the file share at the specified path.
The Update-Help command uses the SourcePath parameter to get the updated help files from the file share, instead of the Internet, and the Credential parameter to run the command with explicit credentials. By default, the command runs with network token privileges and attempts to access the file share from each remote computer (a “second hop”) might fail.

Windows PowerShell

PS C:> Invoke-Command –ComputerName (Get-Content Servers.txt) –ScriptBlock {Update-Help –SourcePath Server01ShareHelp -Credential Domain01Admin01}

Leave a Reply

Your email address will not be published. Required fields are marked *