Problem
You want to learn about how a specific command works and how to use it.
Solution
The command that provides help and usage information about a command is called GetHelp. It supports several different views of the help information, depending on your needs.
To get the summary of help information for a specific command, provide the command’s name as an argument to the GetHelp cmdlet. This primarily includes its synopsis, syntax, and detailed description:
GetHelp CommandName
or
CommandName ? To get the detailed help information for a specific command, supply the –Detailed flag to the GetHelp cmdlet. In addition to the summary view, this also includes its parameter descriptions and examples:
GetHelp CommandName Detailed To get the full help information for a specific command, supply the –Full flag to the GetHelp cmdlet. In addition to the detailed view, this also includes its full parameter descriptions and additional notes:
GetHelp CommandName Full To get only the examples for a specific command, supply the –Examples flag to the GetHelp cmdlet: GetHelp CommandName Examples
Discussion
The GetHelp cmdlet is the primary way to interact with the help system in PowerShell. Like the GetCommand cmdlet, the GetHelp cmdlet supports wildcards. If you want to list all commands that match a certain pattern (for example, *process*), you can simply type GetHelp *process*.
To generate a list of all cmdlets along with a brief synopsis, run the following command:
GetHelp * | SelectObject Name,Synopsis | FormatTable Auto
If the pattern matches only a single command, PowerShell displays the help for that command.
The GetHelp cmdlet is one of the three commands you will use most commonly as you explore Windows PowerShell. The other two commands are GetCommand and GetMember.
For more information about the GetHelp cmdlet, type GetHelp GetHelp.