Pcornel
Windows · PowerShell

Objects

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

Back to the Topic

Answer

PowerShell works with objects that carry type information, properties and methods. The object visible in the pipeline can be richer than the formatted table shown in the console, and remote/serialized objects can differ from live local objects even when properties look similar.

Remember

  • Formatted output is a view of an object, not the object itself.
  • Get-Member reveals type members available in the current pipeline object.
  • PowerShell can add adapted/extended properties through its Extended Type System.
  • Serialized remote objects often preserve data properties but not live methods/behavior.
  • Converting to text early discards structure and makes later filtering/sorting harder.

First checks

  • <cmd> | Get-Member — object type and members
  • $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 emits objects → properties and methods → filtered/selected → formatted or exported

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 → Objects reference map

ItemMeaningEvidence boundary
TypeObject identity/contracttype can change across serialization/module versions
PropertyStructured valuesnapshot value may become stale
MethodBehavior on live objectoften unavailable on deserialized objects
FormattingDisplay projectionnot reliable data contract
SerializationTransport/storage representationcan lose live behavior/type fidelity

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

Confirmation

Confirm action

Continue?