100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

PowerShell Syntax and Cmdlets

Master the Verb-Noun cmdlet naming convention, parameters, aliases, and the pipeline that make PowerShell commands predictable and discoverable.

FoundationsBeginner8 min readJul 10, 2026
Analogies

PowerShell Syntax and Cmdlets

Every built-in PowerShell command, called a cmdlet, follows a strict Verb-Noun naming pattern, such as Get-Process, Stop-Service, or New-Item. The verb always comes from an approved list you can view with Get-Verb (Get, Set, New, Remove, Start, Stop, and dozens more), which keeps cmdlet names predictable: once you know the pattern, you can often guess a cmdlet's name correctly without ever opening documentation.

🏏

Cricket analogy: PowerShell's Verb-Noun naming, like Get-Process or Stop-Service, is as predictable as cricket's over-by-over scorecard notation - once you know the approved verb list (Get-Verb) the way you know 'run out' or 'caught behind' means, any new cmdlet name is instantly readable.

Parameters and Aliases

Cmdlets accept named parameters (Get-ChildItem -Path C:\Temp) and, for the most common ones, positional parameters where the name can be omitted. Common cmdlets also have short aliases baked in for interactive speed - gci, dir, and ls all resolve to Get-ChildItem - and PSReadLine's tab completion works on cmdlet names, parameter names, and even file paths, cycling through matches as you press Tab repeatedly.

🏏

Cricket analogy: Aliases like gci for Get-ChildItem are like a commentator's shorthand 'six over cover' instead of the full technical description - fast in a live broadcast, but a written match report (a script) spells it out fully for clarity.

Getting Help

Get-Help <cmdlet> -Full shows a cmdlet's complete documentation including every parameter, while -Examples strips it down to just runnable sample usages, ideal for a quick reminder. Get-Command lists every cmdlet, function, and alias currently available in the session, and can be filtered by verb or noun (Get-Command -Verb Get -Noun *Item*). The first time you use Get-Help on a fresh install, PowerShell will prompt you to run Update-Help to download the actual help content.

🏏

Cricket analogy: Get-Help with -Examples is like flipping straight to a coaching manual's worked-example net session instead of reading the full theory chapter, while Get-Command is like the team's full squad list you can browse before deciding who to call up.

Get-Command -Verb Get -Noun *Item* is a fast way to discover related cmdlets by pattern before you even know the exact name you need - e.g. it surfaces Get-Item, Get-ChildItem, and Get-ItemProperty in one query.

Combining Cmdlets in the Pipeline

Cmdlets are combined with the pipe operator (|), and inside a script block passed to filtering cmdlets like Where-Object or ForEach-Object, the automatic variable $_ (or its alias $PSItem) refers to the current object being processed. So Get-Process | Where-Object { $_.CPU -gt 50 } | ForEach-Object { $_.Name } filters processes by CPU usage and then extracts just the Name property from each surviving object, one at a time.

🏏

Cricket analogy: The $_ variable inside ForEach-Object | Where-Object is like a fielding coach referring to 'this ball' while reviewing footage - each iteration through the pipeline, $_ points to whichever delivery (object) is currently under review before moving to the next.

Aliases like gci, ls, and % (for ForEach-Object) are convenient interactively but should generally be avoided in saved scripts. Full cmdlet names like Get-ChildItem and ForEach-Object are self-documenting and far more readable to a teammate - or to you six months later - than terse aliases.

powershell
# Full cmdlet names combined with the pipeline and $_ automatic variable
Get-Process |
    Where-Object { $_.CPU -gt 50 } |
    ForEach-Object { "$($_.Name) is using $($_.CPU) seconds of CPU" }

# Discover related cmdlets by verb and noun pattern
Get-Command -Verb Get -Noun *Item*

# Read a specific example from help
Get-Help Get-ChildItem -Examples
  • Cmdlets follow a strict Verb-Noun naming pattern; Get-Verb lists all approved verbs.
  • Parameters can be named (-Path) or, for common ones, positional.
  • Built-in aliases like gci, dir, and ls all resolve to Get-ChildItem.
  • Get-Help -Examples and -Full, plus Get-Command, are the core discovery tools.
  • $_ (or $PSItem) refers to the current object inside a Where-Object or ForEach-Object script block.
  • The pipe operator (|) chains cmdlets so each one's object output feeds the next.
  • Avoid aliases in saved scripts; use full cmdlet names for readability.

Practice what you learned

Was this page helpful?

Topics covered

#Programming#PowerShellStudyNotes#PowerShellSyntaxAndCmdlets#PowerShell#Syntax#Cmdlets#Parameters#StudyNotes#SkillVeris#ExamPrep