Cmdlets and Aliases

Harry · 13 Sep 2026 · 1 views

Cmdlet Anatomy

Cmdlets use Verb-Noun: Get-Process, Set-Service, Remove-Item. Verbs are standard (Get, Set, New, Remove, Start, Stop, Test, Export), making APIs self-documenting.

Aliases

Get-Alias          # list all aliases
ls                 # alias for Get-ChildItem
cat                # alias for Get-Content
gcm                # alias for Get-Command

Aliases are shortcuts only; scripts should use full names for clarity. Remove-Alias cleans clutter.

Parameters

Get-Service -Name 'wuauserv'
Get-Process -Name 'code' -ErrorAction SilentlyContinue
Set-Item -Path . -Value C:work

Most cmdlets accept positional parameters; named parameters are clearer in scripts.

Discovering Cmdlets

Get-Command *-Service
Get-Command -Verb Get
(Get-Command Get-Process).Parameters.Keys

Key Points

  • Verb-Noun naming makes commands predictable.
  • Aliases accelerate typing, full names document.
  • Parameters control behavior precisely.
  • Get-Command is the discovery engine.
Share this post:

Comments (0)

Please login or register to comment.