Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 34 ยท Getting Started

Getting Help

Learn to teach yourself PowerShell: Get-Help with -Examples and -Full, Update-Help, reading syntax, Get-Member, about_ topics and Get-Command -Syntax.

Nobody memorizes every cmdlet. What separates a confident PowerShell user from a lost one is the habit of asking the shell itself. PowerShell has built-in help for commands, built-in documentation for language topics, and a way to ask any object what it can do. You can learn almost the whole tool without leaving the prompt.

This lesson covers Get-Help and its most useful switches, downloading help files with Update-Help, reading the syntax diagram, exploring objects with Get-Member, the about_ topics, and the Show-Command window. The real commands are read-only here. A JavaScript stand-in at the end models a help lookup so you can see how the syntax and example data are organized.

Get-Help basics

Give Get-Help the name of a command:

POWERSHELL
Get-Help Get-Process

The default view shows the name, a synopsis, the syntax (the ways you can call it), a description and remarks. You rarely need all of it at once, so use switches to pick what you want.

POWERSHELL
Get-Help Get-Process -Examples    # only the examples (start here)
Get-Help Get-Process -Detailed    # parameters with descriptions plus examples
Get-Help Get-Process -Full        # everything, including input and output types
Get-Help Get-Process -Parameter Name   # help for a single parameter
Get-Help Get-Process -Online      # open the web version in your browser

-Examples is the one you will use most. Real, short, copyable examples tell you in seconds how a command is meant to be used. -Parameter accepts wildcards, so -Parameter * lists every parameter.

You can use help (a function that pages the output one screen at a time) and man (an alias for help) as shortcuts. Add -? after a command, as in Get-Process -?, for a quick display of the same help.

Four ways to ask

Get-Help Read how a command works.
Get-Command Find which commands exist.
Get-Member See what an object offers.
about_ topics Read about language features.

Help, discover, inspect, read.

1 / 2

Update-Help and the help files

Help is not stored inside the cmdlets themselves. It lives in separate help files that you can download. PowerShell 7 does not include the help content, and Windows PowerShell 5.1 ships with only the basics. The first time you ask for help you may see only the syntax and a note that the help files are not installed. Download them with:

POWERSHELL
Update-Help
Update-Help -Scope CurrentUser   # PowerShell 7: no administrator rights needed

In Windows PowerShell 5.1, updating help for system modules needs an elevated (administrator) session. After the download, Get-Help shows full descriptions and examples. Run Update-Help again every so often; the content is updated by Microsoft. You can also read the same material online with -Online, which works even if you never download anything.

Reading the syntax

The syntax section looks cryptic until you know four rules.

TEXT
Get-Process [[-Name] <string[]>] [-Module] [-FileVersionInfo] [<CommonParameters>]
Notation Meaning
[ ... ] around a parameter The parameter is optional
[-Name] in brackets inside brackets The parameter name is optional (it is positional)
<string[]> The type of value it accepts; [] means several values are allowed
a parameter with no <type> A switch, such as -Module
several syntax lines Different parameter sets, mutually exclusive ways to call the command

Reading the line above: Get-Process takes an optional Name (you can even leave off the word -Name), which can be a list of strings, and optional switches. So Get-Process pwsh, code is valid.

To get just the syntax without the reading, use Get-Command:

POWERSHELL
Get-Command Get-Process -Syntax

Get-Member: help for objects

Get-Help explains commands. Get-Member explains what a command returned. Pipe any output to it:

POWERSHELL
Get-Date | Get-Member
Get-Process | Get-Member -MemberType Property
"text" | Get-Member -MemberType Method

Each row tells you the member's name, its kind (Property, Method, Event and so on) and its definition. It also shows the object's type name at the top, for example System.DateTime. You will use it constantly in Objects, Properties and Methods to find the property you want to sort or filter on.

about_ topics

Not everything is a command. Topics such as operators, loops, scopes and error handling live in about_ help articles:

POWERSHELL
Get-Help about_*                      # list every about topic
Get-Help about_Operators
Get-Help about_Comparison_Operators
Get-Help about_Functions

These are the language reference that ships with PowerShell. They are long, so pipe them to a pager (help about_Operators pages for you) or read them online. When a later lesson mentions an operator or a block, the matching about_ topic is the place to check the exact rules.

Show-Command

On Windows, Show-Command opens a small form for a cmdlet. It shows every parameter as a field, marks the mandatory ones, groups parameter sets in tabs and lets you run the command or copy the finished command line.

POWERSHELL
Show-Command Get-Process

It is a pleasant way to learn a command with many parameters. It needs a graphical desktop, so it is not available in every environment (for example a plain remote SSH session).

A habit that works

  1. You do not know the command: Get-Command -Noun Service.
  2. You know the command, not how to use it: Get-Help Stop-Service -Examples.
  3. You have output and want the right property: ... | Get-Member.
  4. You are stuck on a language rule: Get-Help about_Comparison_Operators.

Try it: a help lookup

This stand-in builds a miniature help system in JavaScript from structured data. It does not contain real PowerShell help. It shows why -Examples can print only the examples, and how the syntax line is built from parameter metadata.

JS Stand-in: a tiny Get-Help

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Listing members of an object

Get-Member works because every .NET object can be inspected. This second stand-in does the same for a JavaScript object: it lists each member, its kind and the type name. The real Get-Member is richer, but the idea is identical.

JS Stand-in: Get-Member for a JavaScript object

Press Run (or Ctrl + Enter) to see the console output here.

No output.

What is real: the commands in the powershell blocks and the idea that Get-Help, Get-Command and Get-Member answer different questions. What is the stand-in: the help text, the parameter data and the member list above are small imitations written for this lesson.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Which command shows only the usage examples for Stop-Service?

    -Examples filters the help to its example section. -Full prints everything and Get-Member inspects objects, not command documentation.
  2. 2. In the syntax Get-Process [[-Name] <string[]>], what does [-Name] in its own brackets mean?

    The outer brackets make the whole parameter optional; the inner brackets make just the name optional, so Get-Process pwsh works.
  3. 3. You want to know which properties an object returned by a command has. What do you pipe it to?

    Get-Member lists the properties, methods and the type name of whatever objects arrive on the pipeline.
  4. 4. Where would you read the rules for comparison operators?

    Language topics live in about_ articles. Get-Help about_* lists them all.
  5. 5. Why might Get-Help show little more than syntax on a fresh PowerShell 7 install?

    Help content is downloaded separately. After Update-Help, or with -Online, the full text is available.

Summary

  • Get-Help <command> -Examples is the quickest way to learn a command; -Full, -Parameter and -Online give more.
  • Update-Help downloads the help files; -Scope CurrentUser avoids needing administrator rights in PowerShell 7.
  • Learn to read syntax: brackets mean optional, <type> is the value type, no type means a switch.
  • Get-Member explains what a command returned; Get-Command -Syntax prints the syntax only.
  • about_ topics document the language; Show-Command is a form-based helper on Windows.

Next: Objects, Properties and Methods.