PowerShell Basics Level: Beginner Chapter 2: Your First PowerShell Commands

Getting help: Get-Help, About, and IntelliSense

PowerShell documents itself. Get-Help explains a command, About topics explain concepts, and Ctrl plus Space completes names for you.

Lesson 5 of 5 in Chapter 2: Your First PowerShell Commands. Previous step in this path: Syntax: Verb-Noun and parameters. 3 learning objectives, 6 examples, and a knowledge check.

Start: what you will learn

PowerShell documents itself. Get-Help explains a command, About topics explain concepts, and Ctrl plus Space completes names for you.

Learning objectives

  • Use Get-Help to read syntax, parameters, and examples
  • Find a concept topic with Get-Help about_*
  • Use Ctrl plus Space to complete a command

Concept in simple words

What it is: Getting help in PowerShell means asking PowerShell itself to explain a command or a concept, mainly with Get-Help, which shows help for one command, and About topics, which explain a concept such as variables. IntelliSense is a third kind of help. It suggests names as you type, so you do not have to remember every spelling from memory.

Why it works

Why it exists: PowerShell has hundreds of commands, and each command has its own parameters. No one remembers all of them. Built in help exists so you can learn a command at the moment you need it, from the tool itself, instead of stopping your work to search the web or to guess.

What problem it solves: Guessing is the most common beginner mistake, and it is also the most dangerous one, because a close guess can be a different command with a different effect. Help solves that problem by showing you the real syntax, the real parameters, and real examples for the command on your computer, in your edition.

Why it works this way: Help files are built to match the commands on your computer, so they describe the parameters and examples that actually exist in your version. That makes built in help more reliable than a random example online, which may come from a different version or a different edition. If help and a web example disagree, trust the help for your edition first, then check the version difference.

Think of it like this

Think of it like this: Get-Help is like the manual that comes inside the box, written for the exact tool you hold. Searching the web is like asking a stranger about a similar tool. The manual is the safer first stop, and the web is useful after you know what you are asking about.

A second analogy that helps: Think of a recipe book that came with your oven. It knows your oven model, its settings, and its limits. A recipe from another oven may still work, but it may also assume a setting your oven does not have. Get-Help is the book for your model, so start there.

How a help page is organised: A full help page has sections with clear headings. NAME gives the command name. SYNOPSIS gives a one line summary. SYNTAX shows the shape of the command, including its parameters. DESCRIPTION explains what it does. PARAMETERS explains each parameter, one by one. EXAMPLES shows numbered usage patterns. INPUTS and OUTPUTS say what kind of object goes in and comes out. You do not need to read every section every time. Start with SYNOPSIS and EXAMPLES, then go to PARAMETERS only for the parameter you need.

How it works, step by step

How it works, step by step: First, type Get-Help followed by the command name, for example Get-Help Get-Service, and press Enter. Read the short description and the syntax, which shows the shape of the command. Then add -Examples to see real usage patterns, which are often the fastest way to understand a command.

How it works, step by step, continued: Next, if you want a concept rather than one command, use an About topic, for example Get-Help about_Variables. You can also list all concept topics with Get-Help about_*, where the star means any text after about_. In the console or in Visual Studio Code, press Ctrl plus Space for IntelliSense, which suggests names as you type, and press Tab to complete a name.

Parameters of Get-Help, one by one: -Examples shows only usage examples, and it is the best first step for learning. -Detailed shows more than the short view, including parameter descriptions and examples. -Full shows the complete page, with every parameter explained in detail. -Parameter followed by a name, such as -Parameter Name, shows only that one parameter, which is useful when you already know the command and only need one detail. -Online opens the online version of the help page in your browser, which needs internet access.

An important rule about Get-Help views: -Full, -Detailed, -Examples, -Online, and -Parameter belong to different views of the help, so you cannot combine them all in one command. Pick the view that fits your question. If you want examples, use -Examples. If you want one parameter, use -Parameter. If you want everything, use -Full, and be ready for a long page.

Let us walk through an example: In Get-Help Get-Service -Examples, Get-Help is the help command, Get-Service is the command you want to learn about, and -Examples is a switch, which is a parameter with no value that simply turns something on. The output shows numbered examples, each with a command and a short note, so you can copy the pattern and change the value to fit your task.

Walkthrough, what changes if you change one part: If you drop -Examples, you get the short help page, with synopsis and syntax, but no usage examples. If you change -Examples to -Full, you get the whole page, which is longer and harder to scan, but complete. If you change Get-Service to Get-Process, you get help for a different command, with its own parameters and examples. The help command stays the same. Only the target changes.

Let us walk through a second example: In Get-Help Get-Service -Parameter Name, Get-Help is the help command, Get-Service is the target, -Parameter says you want one parameter explained, and Name is that parameter. Look for the parameter name, its type, whether it is required, and a short description. This is the fastest way to answer a narrow question, such as what values does -Name accept, without reading the whole page.

Let us walk through a third example: In Get-Help about_Variables, about_ marks a concept page, not a command, and Variables is the concept. The page explains the idea itself, such as how variables store values you can use and change later. Use About topics when you are stuck on an idea, such as variables, the pipeline, or comparison operators, rather than on one command. If you do not know the exact topic name, Get-Help about_* lists the concept topics available on your computer.

IntelliSense and Tab, in depth: IntelliSense is name suggestion as you type. In the console, Ctrl plus Space opens a menu of possible completions for what you have typed so far, and you can move through the menu with the arrow keys. Tab completes a name to the next match, and pressing Tab again cycles to the next match. In Visual Studio Code, the PowerShell extension also suggests names as you type in the editor. IntelliSense does not run the command. It only helps you spell it, so you still need to read the command before you press Enter.

Update-Help, in depth: Update-Help downloads and installs the newest help files for your modules. It needs internet access, or a saved copy from a connected computer, to fetch those files. In PowerShell 7 and later, the default scope is the current user, so updating your own help files does not always need administrator rights. But updating the core help files, the ones installed with PowerShell itself, does need administrator rights, because those files live in a protected folder. If Update-Help reports a permission problem, that is the likely cause, and the fix is to run it in an elevated session for the core modules, or to read the online help instead.

When to use it

When to use it, and when not to: Use Get-Help before you run a command you have not used before, and use -Examples first, then -Full only when you need every parameter explained. Do not skip help and guess a parameter, because a close guess can change or delete something you did not intend. Do not use -Online when you have no internet access, and do not expect Update-Help to work without internet access or, for core modules, without the needed permission.

Common edge cases to expect: First, on a fresh install, Get-Help may show only basic help until Update-Help has run, and it may prompt you to update. That is normal. Second, -Online opens a browser window, which can be surprising if you expected text in the console, so only use it when you want the web page. Third, IntelliSense suggestions depend on what PowerShell knows in your session, so a command from a module that is not loaded may not appear until that module is available.

Worked examples

Read each example in order. Each one explains its parts, then shows what to look for in the output.

Syntax

Syntax
Get-Help <CommandName> [-Examples | -Full]

Example 1

Shows practical examples first. Examples are the fastest way to learn a new command.

Example 1
Get-Help Get-Service -Examples

Illustrative output: EXAMPLE 1: Get-Service -Name Spooler Returns the Spooler service.

Example 2

Downloads the newest help files. Run it once in a while, and run it as administrator if it asks.

Example 2
Update-Help

Illustrative output: Help updated for the installed modules.

Example 3

This asks for a concept topic, not help for one command. The name starts with about_, which marks it as a concept page, and Variables is the concept. Use About topics when you want to understand an idea, such as how variables work, rather than the details of one command.

Example 3
Get-Help about_Variables

Illustrative output: ABOUT VARIABLES Variables store values that you can use and change later.

Example 4

The short help page, with no view switch. Look for the NAME and SYNOPSIS sections first, then the SYNTAX section, which shows the shape of the command. Use this form when you only need a quick reminder of what the command does, then add -Examples when you need usage patterns.

Example 4
Get-Help Get-Service

Illustrative output: NAME Get-Service SYNOPSIS Gets the services on a computer.

Example 5

Shows only the -Name parameter of Get-Service. Look for the parameter name, its type, whether it is required, and its description. Use this form when you already know the command and only need to check one parameter, instead of reading the full page.

Example 5
Get-Help Get-Service -Parameter Name

Illustrative output: -Name Specifies the service names to retrieve.

Example 6

Opens the online help page for Get-Service in your browser. This needs internet access, and the result appears in a browser window, not in the console. Use it when you want the newest online page, and use -Examples when you want to stay in the console.

Example 6
Get-Help Get-Service -Online

Illustrative output: Opening the online help page for Get-Service in your browser.

Nothing on this page executes PowerShell code. The outputs above are illustrative only.

Common mistakes and troubleshooting

Read these before you try the examples, so you can spot the same problems in your own work.

  • Skipping -Examples and reading only the syntax, which is harder to learn from.
  • Running Update-Help and expecting it to work without internet access or permission. It needs both.
  • Reading only the syntax line of a help page and skipping -Examples, then struggling to use a command that the examples would have made clear in seconds.
  • Combining help views that do not go together, such as -Full and -Examples in one command. Pick one view per command, and run a second command if you need another view.
  • Expecting full help on a fresh install before Update-Help has run. If the page looks thin, update the help files, or read the online page, instead of assuming the command has no help.
  • Trusting IntelliSense spelling over meaning. A completed name can still be the wrong command, so read the full command and its help before you press Enter.

Knowledge check

Knowledge check

Which switch shows practical examples for a command?

Pick one answer. Feedback appears right away, and you can try again.

Remember this and next step

Remember this: Get-Help explains a command, About topics explain concepts, -Examples shows usage, -Parameter explains one parameter, and Ctrl plus Space plus Tab help you type names correctly. Help first, guess never, and read the example before you run the command.

Next step: Variables