PowerShell command names follow a Verb-Noun convention such as `Get-Process`. What does that convention buy you, and how would you find a command whose name you do not know?
answer
- approved verb, singular noun
- guess the name before you search it
- Get-Command filters by verb and noun
- Get-Help for parameters, Get-Member for output
- unapproved verbs warn on module import
basics
~20 sVerb-Noun names make PowerShell predictable and searchable: the verb comes from an approved list describing the action, the noun names the thing acted on. Because the shape is uniform, Get-Command can filter by verb or noun and Get-Help documents any command you find.
solid answer
~40 sEvery well-behaved PowerShell command is `Verb-Noun` — `Get-Process`, `Stop-Service`, `New-Item` — where the verb comes from the approved set that `Get-Verb` prints and the noun is singular even when the command returns many objects. The payoff is guessability: once you know `Get-`/`Set-`/`New-`/`Remove-`/`Start-`/`Stop-` mean the same thing everywhere, you can predict half a module's surface. Discovery then has two steps: `Get-Command -Noun Service` or `Get-Command *firewall*` to find candidates, then `Get-Help Stop-Service -Examples` (or `-Full`) to learn the parameters, plus `Get-Member` to see what the output objects carry. It also matters when you write commands yourself — importing a module whose functions use unapproved verbs raises a warning, because unapproved verbs are exactly what makes a command undiscoverable.
code
powershell · 4 linesGet-Verb | Where-Object Group -eq 'Lifecycle'
Get-Command -Noun Service
Get-Help Restart-Service -Examples
Get-Service | Get-Membergo deeper
Know the shape: an approved verb, a hyphen, a singular noun. Be ready to name Get-Command to find a command and Get-Help to learn how to call it.
Explain that Get-Verb defines the approved set and that -Verb and -Noun filtering only works because names are structured; add Get-Member to inspect what the command returns.
Show the reviewer's angle: pick approved verbs and prefixed nouns in code you ship, keep aliases out of shared scripts, and treat the import-time unapproved-verb warning as a real defect.
Argue the convention as an API contract across a whole module estate — consistent verbs and namespaced nouns are what let a team discover and script an unfamiliar surface without documentation.
## The convention A PowerShell command name has two parts separated by a hyphen: a **verb** describing the action and a **noun** describing what is acted on. `Get-Process`, `Set-Content`, `New-PSSession`, `Remove-Item`, `Invoke-Command`, `Test-Path`. Two rules make it more than cosmetic: 1. **The verb comes from an approved list.** Run `Get-Verb` to print it. The verbs are grouped — Common (`Get`, `Set`, `New`, `Add`, `Remove`, `Clear`), Lifecycle (`Start`, `Stop`, `Restart`, `Enable`, `Disable`, `Install`), Data (`Import`, `Export`, `Backup`, `ConvertTo`), Diagnostic (`Test`, `Measure`, `Trace`, `Debug`), Security (`Grant`, `Revoke`, `Protect`), and others. The point is to have exactly one word for each idea, so nobody ships `Retrieve-User` next to someone else's `Fetch-User` and `Read-User`. 2. **The noun is singular**, even for commands that return collections. It is `Get-Process`, not `Get-Processes`, because the noun names the kind of thing, not the count. Modules commonly prefix their nouns to avoid collisions — a vendor module might expose `Get-AzVM` or `Get-SqlDatabase` — which keeps the noun both unique and searchable. ## Why an interviewer cares The convention turns a shell with thousands of commands into something you can navigate without memorising it. If you know a module manages services, you can guess that `Get-Service`, `Start-Service`, `Stop-Service` and `Restart-Service` exist before you look. That predictability is the whole design goal, and it is the reason PowerShell rejects clever names. ## The discovery loop The practical answer to "how do I do X in PowerShell" is a three-command loop. ```powershell # 1. Find candidate commands Get-Command -Noun Service Get-Command -Verb Restart Get-Command *firewall* -CommandType Cmdlet, Function Get-Command -Module Microsoft.PowerShell.Management # 2. Learn how to call one Get-Help Restart-Service -Examples Get-Help Restart-Service -Full Get-Help Restart-Service -Online # 3. Learn what it gives back Get-Service | Get-Member ``` `Get-Command` searches the commands currently visible to the session — cmdlets, functions, aliases, scripts and native applications on `PATH`. Filtering by `-Verb` and `-Noun` only works because names are structured; that is the convention paying for itself. `Get-Help` is the documentation reader. On a fresh Windows PowerShell installation the local help content may be absent, and `Get-Help` shows only auto-generated syntax until you run `Update-Help` to download it. `-Examples` is usually the fastest way in; `-Full` adds every parameter's type, position, pipeline-binding and default; `-Online` opens the published page in a browser. `Get-Member` closes the loop by describing the *output*, which the help text alone rarely makes vivid: it prints the object's type name plus its properties and methods, so you know what the next stage of your pipeline can filter and sort on. ## Aliases and the readability rule Many commands have short aliases for typing: `gcm` for `Get-Command`, `?` for `Where-Object`, `%` for `ForEach-Object`, `select` for `Select-Object`, `sort` for `Sort-Object`, `ft` for `Format-Table`. `Get-Alias` lists them and `Get-Alias -Definition Where-Object` resolves the other direction. The house rule almost everywhere is: aliases at the interactive prompt, full Verb-Noun names in anything another person will read, because aliases can be redefined and are not self-describing. ## When you write commands The convention is not only for consumers. Name your own functions `Verb-Noun` with an approved verb and, ideally, a prefixed noun. If a module exports functions using unapproved verbs, `Import-Module` emits a warning about names containing unapproved verbs — annoying by design, because those commands will not be found by anyone filtering on `-Verb`. `Import-Module -DisableNameChecking` silences the warning without fixing the underlying discoverability problem, which is why it is a poor default. ## What a weak answer looks like Saying "Verb-Noun is just a naming style" misses the mechanism: the approved verb list plus `Get-Command`'s verb and noun filters are what makes the shell self-documenting. The other common miss is not knowing where the list lives — the answer is `Get-Verb`, not a page you have to remember.
- Where does the list of approved verbs actually come from, and what happens if you ignore it?`Get-Verb` prints the built-in list with the group each verb belongs to. Ignoring it is not a hard error — your function still runs — but `Import-Module` warns that the module exports commands with unapproved verbs, and those commands become invisible to anyone searching with `Get-Command -Verb`. `-DisableNameChecking` hides the warning without fixing discoverability.
- You use `%` and `?` constantly at the prompt. Why do reviewers object to them in shared scripts?Aliases are for typing speed, not for reading. They are not self-describing, they can be redefined in a profile, and some are not defined on every platform or host. Shared code should spell out `ForEach-Object` and `Where-Object`; keep the one-character forms for the interactive session where you can see the result immediately.
- Why is the noun singular even when the command clearly returns many objects?Because the noun names the type of thing, not the quantity, and PowerShell has no separate scalar and collection commands — `Get-Process` returns one object or many depending on the filter. Keeping nouns singular makes the name predictable so you never have to remember whether a module chose the plural form.
saying these in an interview costs you the question
- Calls Verb-Noun a style choice with no mechanism behind it
- Cannot name Get-Command or Get-Help as the discovery tools
- Invents verbs like Fetch- or Retrieve- for new functions
- Thinks nouns should be plural when many objects are returned
- Uses aliases such as % and ? throughout shared scripts