Pcornel
Automation · PowerShell Automation

Objects

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

Back to the Topic

Answer

PowerShell passes .NET objects, not text, between commands, so properties can be selected, filtered and sorted directly, such as Get-Process | Where-Object CPU -gt 100.

Remember

  • PowerShell passes .NET objects, not text.
  • Filter with Where-Object and select with Select-Object.
  • Get-Member shows properties and methods.

First checks

  • Get-Service | Get-Member — object properties/methods
  • Get-Process | Select-Object Name,CPU -First 5 — select properties
  • $obj | ConvertTo-Json -Depth 5 — serialise

Verify in this order

cmdlet → .NET objects → properties

Where it usually breaks

Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload.

Objects · PowerShell operational reference

BoundaryObjects reference
Runtime identityPowerShell edition/version + command/module source
Persistent intentScript/module/config prerequisites under source control
VerificationRead-only discovery → execution evidence → independent target read-back
Output contractStructured objects/streams before formatting
Failure boundarySeparate engine/binding from transport/API/native and target-state failures

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

Confirmation

Confirm action

Continue?