← PowerShell course
1

Cmdlets, Objects & the Pipeline

20 min

The three ideas that make PowerShell click: Verb-Noun cmdlets, objects (not text), and the pipeline.

By the end you can
  • Understand why PowerShell passes objects, not text
  • Read any cmdlet's name from its Verb-Noun shape
  • Discover and inspect commands with Get-Command, Get-Help and Get-Member
  • Chain cmdlets together with the pipeline

Why PowerShell is different

If you come from Bash, the single most important thing to unlearn is this: PowerShell pipes objects, not text.

In Bash, every command spits out a stream of text and the next command has to re-parse it (hence awk, cut, sed). In PowerShell, a command hands the next one a real object with named properties and methods. No fragile string-scraping.

# Bash thinking: grep the text, cut the column you hope is right
# PowerShell thinking: ask the object for the property by name
Get-Service | Where-Object Status -eq 'Running'

Cmdlets are Verb-Noun

Every built-in command (a cmdlet) is named Verb-Noun, always singular:

CmdletReads as
Get-Serviceget the service(s)
Restart-Servicerestart a service
Stop-Processstop a process
Get-EventLogget the event log

Verbs are from an approved list (Get, Set, New, Remove, Start, Stop, Restart…), so once you know the noun you can usually guess the command. This consistency is why PowerShell scales from one server to ten thousand.

The three commands that teach you everything

You never need to memorise cmdlets — you need to know how to discover them:

Get-Command *service*       # find every command with 'service' in the name
Get-Help Restart-Service -Examples   # see real usage examples
Get-Service | Get-Member    # list the properties & methods of the objects

Get-Member is the secret weapon: pipe anything into it and it tells you exactly what properties you can select and filter on. When you're stuck, Get-Member is the answer.

The pipeline

The | passes the objects from one cmdlet to the next. Each stage refines the last:

Get-Service |
  Where-Object Status -eq 'Running' |
  Select-Object Name, DisplayName |
  Sort-Object Name

Read it top to bottom: get the services → keep the running ones → take two properties → sort them. That readable, composable flow is PowerShell at its best.