PowerShell Genie

Your first Verb-Noun command

Every PowerShell command is named Verb-Noun. The verb says what you are doing, the noun says what you are doing it to. Get-Process, Stop-Service, New-Item, Remove-Item. Once you know the pattern you can often guess a command name correctly on the first try, which is the point.

Lesson 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Overview

The verbs are not arbitrary. PowerShell defines an approved list, grouped by meaning: Get retrieves, Set modifies, New creates, Remove deletes, Start and Stop control execution, Test checks a condition and returns true or false. Get-Verb prints the whole list. Because the list is enforced by convention across every well-written module, Get conventionally retrieves information and Remove deletes it. A verb is not a safety guarantee: inspect unfamiliar commands, their source and their effects before running them.

Nouns are singular by convention, even when the command returns many things. Get-Process, not Get-Processes.

The pipe, again

You met the pipe (|) in the version lesson: it feeds the objects from the command on its left into the command on its right — read it as "then". Here it does the same job: Get-Command -Verb Get produces a list of command objects, then Select-Object -First 10 Name keeps the first ten and shows only their Name property. The commands never turn into text in between — that is why no parsing is needed.

What happens

Get-Command -Verb Get asks for every command whose verb is Get, and the pipeline hands that list to Select-Object, which keeps the first ten and shows only the Name property. The output is a sample of the read-only commands available to you. Swap Get for Set or Remove to see the commands that change things.

Worth remembering

  • Verb-Noun is a rule, not a style preference.
  • Get-Verb lists every approved verb.
  • Get conventionally retrieves information. Naming alone cannot guarantee that a command is read-only; inspect unfamiliar implementations.
  • Nouns are singular even when output is plural.

Primary documentation

Get-Command reference · Select-Object reference

Try it

Browser simulation · fictional data; no changes to your computer.

Interactive simulation · fictional data

Lists ten commands that use the Get verb, so you can see the naming pattern in real names. Sample output — the exact names and order depend on your installation.

Show reference output

Sample output · fictional data, shaped like the real thing

Name         
-------------
Get-Service  
Get-Process  
Get-ADUser   
Get-AzVM     
Get-ChildItem

Practise this

Run your first service command

Display the Spooler service and its complete properties.

Review the lesson

Keep going

Next: Get-Command
Genie guideYour first Verb-Noun command

Every PowerShell command is named Verb-Noun. The verb says what you are doing, the noun says what you are doing it to. Get-Process, Stop-Service, New-Item, Remove-Item. Once you know the pattern you can often guess a command name correctly on the first try, which is the point.