In PowerShell, Get-Help
and help
both serve the purpose of providing documentation, but they differ in their functionality, source of information, and how they present that information. While Get-Help
is a core cmdlet that retrieves help content directly from files on your computer, help
is typically an alias or function designed to display that information one screen at a time for easier readability.
Understanding Get-Help
Get-Help
is a fundamental cmdlet in PowerShell used to access detailed help documentation for commands, cmdlets, functions, scripts, and even PowerShell concepts. It's the primary tool for comprehensive information retrieval.
Key Characteristics of Get-Help
:
- Source of Information:
Get-Help
retrieves the help content it displays from help files stored directly on your computer. This means the information is readily available offline once the help files are updated. - Comprehensive Output: It provides extensive details, including a command's syntax, parameter descriptions, examples, related commands, and more.
- Customizable Views:
Get-Help
supports various parameters to tailor the output:Get-Help <CommandName> -Full
: Displays complete help, including parameter attributes and detailed examples.Get-Help <CommandName> -Examples
: Shows only the examples section.Get-Help <CommandName> -Detailed
: Provides a detailed view without being as exhaustive as-Full
.Get-Help <CommandName> -Online
: Opens the web-based version of the help documentation in your default browser, if available.Get-Help <CommandName> -ShowWindow
: Displays the help in a separate, scrollable window.
- Direct Access: You can directly pipe the output of
Get-Help
to other cmdlets, making it highly scriptable for automation and analysis. - Alias: The shortcut
<cmdlet-name> -?
is identical toGet-Help <cmdlet-name>
for cmdlets, offering a quick way to access basic help. For example,Get-Service -?
is the same asGet-Help Get-Service
.
Practical Example of Get-Help
:
To get full help for the Get-Service
cmdlet:
Get-Help Get-Service -Full
Understanding Help
The help
command in PowerShell is generally an alias or a function that acts as a wrapper, primarily designed for user convenience. Its main purpose is to present information in a more consumable format, especially when dealing with large outputs.
Key Characteristics of Help
:
- Paging Output: When you type
help <CommandName>
, it typically displays the help content one screen of text at a time. This is invaluable when the help documentation is long, preventing it from scrolling past too quickly in the console. - Underlying Mechanism: In many PowerShell environments,
help
is an alias forGet-Help | more
. Themore
cmdlet is responsible for the screen-by-screen display. - Simplified Usage: It's a quick and easy way to get basic information without needing to remember
Get-Help
's specific parameters for paging. man
Alias: Theman
command (short for "manual") is also an alias forhelp
in PowerShell, providing a familiar Unix-like command for many users.
Practical Example of Help
:
To get paginated help for the Get-Process
cmdlet:
help Get-Process
Comparing Get-Help
and Help
The following table summarizes the key differences between Get-Help
and help
:
Feature | Get-Help (Cmdlet) |
Help (Alias/Function) |
---|---|---|
Type | Cmdlet | Alias/Function (often Get-Help | more ) |
Purpose | Retrieve comprehensive help content | Display help content one screen at a time (paginated) |
Information Source | Local help files on your computer | Relies on Get-Help to fetch content, then formats it |
Output Display | Displays full content immediately unless piped | Displays content page by page, requiring user input to advance |
Flexibility | Highly flexible with many parameters (-Full , -Examples , -Online , -ShowWindow ) |
Less flexible, primarily for paginated display |
Aliases/Shortcuts | <cmdlet-name> -? |
man |
Scriptability | Easily scriptable, output can be piped and processed | Primarily for interactive console use |
When to Use Which?
- Use
Get-Help
when you need:- Comprehensive details, including full syntax, detailed parameter descriptions, or specific examples.
- To access help documentation online (
-Online
) or in a separate window (-ShowWindow
). - To integrate help information into a script or process its output programmatically.
- To update local help files using
Update-Help
.
- Use
help
(orman
) when you need:- A quick overview of a command's functionality and parameters without the output scrolling rapidly.
- To casually browse help content interactively in the console.
- A simple, paginated display that is easy to read.
In essence, Get-Help
is the engine that provides the raw data from your local help files, while help
is often the user-friendly interface that presents that data in a manageable, paginated format.