Eric Ransom Writing Projects Other Stuff Contact

Header image

Understanding Powershell Get-Help Output

Purpose of this article

One of the biggest obstacles to getting started with Windows Powershell is learning how to use the output of the Get-Help cmdlet. At first glance, an absolute mess of output is given that can be confusing. Once you know how to parse the output of this command, learning how to use new cmdlets is pretty straightforward.

Updating local help files

Before getting started, you will want to run the following command to make sure you have updated help files:

By default, Windows does not come with help files stored locally for Powershell cmdlets, so you will need to run this command at least once to get everything downloaded. If you have done this previously, you can still run this to fetch updates.

If you want to run this task in the background in powershell, you can do so by using this command:

This starts a background job for the task, and you can check the status of background jobs using:

Sections of help output

Let's run the following command to get some sample help output:

Sample Help Output using Get-Help Get-Help

There are 3 main sections of the output that will give us useful info:

The Synopsis and Description sections are useful and straightforward, so our focus will be on the Syntax portion.

The basic structure of the syntax section is:

Parameter sets

As seen in the screenshot above, there are six sets of parameters listed that look mostly identical. The most important thing to understand here is that each of the 6 sets of parameters is exclusive. You cannot mix parameters from different sets in a single command (unless that parameter appears in both sets).

For example, the first set contains the -Detailed parameter, but not the -Examples parameter. The second set contains -Examples, but not -Detailed. So the following command is not valid:

You will get an error that looks like this:

Get-Help Parameter Error

By contrast, choosing only parameters from a single set will provide valid output. The following command is valid since both are included in a single parameter grouping from above:

So to summarize, use the Syntax section to help forming a valid command, but only use parameters from a single set from the Syntax section to avoid errors.

But what do these parameters do?

That's all well and good, but what do any of these parameters actually do? Annoyingly, the default output of Get-Help does not actually tell us what any of the parameters do. You need the following parameter:

Notice that this provides another section which tells us what all of these parameters actually do:

Get-Help Parameter Error

This output will provide a detailed description of every command parameter. Since this seems (to me) to be the most useful part of the help documentation, I have no idea why it is not included by default. In any case, this output will help you sort out which parameters you need.

The -Detailed parameter will also display examples of the command being used. If you want to display these examples without all of the other detail included, you can use:

Key Points

Published: October 19, 2020.

Last updated: October 19, 2020

Correction and Edit History:

*License Info: This article is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)

Licensed under CC BY-SA 4.0