Pcornel
Windows · PowerShell

Cmdlets

Cheat sheet · https://pcornel.dk/topic.php?topic=3039

Back to the Topic

Answer

A cmdlet is a compiled or script-based PowerShell command designed to participate in PowerShell parameter binding and object pipelines. Cmdlets normally use approved Verb-Noun names and expose metadata such as parameters, parameter sets and pipeline-input capabilities.

Remember

  • Cmdlet names identify intent, but the module/source still matters.
  • Parameter sets define valid combinations; a parameter can be mandatory only in specific sets.
  • Pipeline binding can occur by value or by property name depending on command metadata.
  • Common parameters are provided by advanced functions/cmdlets through the PowerShell runtime.
  • -WhatIf describes intended ShouldProcess actions; it is not a universal simulator of every external side effect.

First checks

  • $PSVersionTable — PowerShell edition and version
  • Get-Command <name> — which cmdlet/function/exe runs
  • Get-Help <cmdlet> -Full — syntax and parameters
  • Get-ExecutionPolicy -List — execution policy per scope

Verify in this order

cmdlet name resolved → parameters bound → runs → objects returned

Where it usually breaks

First mismatch in definition/configuration → security context → service/task/process creation → runtime state → output/side effect → event/performance evidence; preserve identity/native error/pre-state before mutation.

PowerShell → Cmdlets reference map

ItemMeaningEvidence boundary
Verb-NounNaming conventionname does not prove module/source
Parameter setValid parameter combinationbinding failure can occur before action
Pipeline inputBy value/property namesuccessful binding does not prove data correctness
ShouldProcessChange-confirmation contractWhatIf is limited to implemented actions
Output objectStructured resultreturned object may be request/result, not final target state

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3039

Confirmation

Confirm action

Continue?