PowerShell Essentials: Get-Help

by Apr 22, 2009

Get-Help is the second of the three most important PowerShell cmdlets as it retrieves all the Help for any cmdlet. If you just enter Get-Help, you get help for Get-Help itself. Add a cmdlet name, and you get help for that command.

Get-Help can even resolve aliases. So when you enter:

Get-Help dir

You get help for Get-Childitem because the alias "dir" points to that cmdlet.

Without additional parameters, Get-Help provides only a quick overview. Add the parameter -detailed or -full to get complete Help:

Get-Help dir -detailed

If you want to get Help for a specific parameter, use -parameter and the parameter names. Wildcards are allowed so to see all parameter descriptions, so you should use this:

Get-Help dir -parameter *

Very often, you already know basically what a cmdlet does so you may only want to see some examples. Use -examples for that:

Get-Help Dir -examples

Finally, Get-Help can even guess so if you'd like to do something with printers, enter this:

Get-Help print

In this case, you get back the Help for Out-Printer as it is the only cmdlet related to printing. If you enter a search phrase that applies to more than one cmdlet, you get back a list of all found cmdlets like this:

Get-Help Service

Since sometimes Get-Help provides a lot more information than fits on one screen page, you can either pipe the result to more.com:

Get-Help Dir -full | more.com

Or you use the pre-defined function help, which does pagination automatically:

help Dir -full