Pcornel
Automation · PowerShell Automation

WMI

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

Back to the Topic

Answer

WMI is the older Windows management interface queried with Get-WmiObject in Windows PowerShell. PowerShell 7 uses the CIM cmdlets instead, which use the same classes over WS-Man.

Remember

  • Get-WmiObject exists only in Windows PowerShell.
  • Use Get-CimInstance in PowerShell 7.
  • The classes are the same.

First checks

  • Get-CimClass -Namespace root/cimv2 | measure — available classes
  • winmgmt /verifyrepository — repository check
  • Legacy Get-WmiObject usage — migrate to CIM

Verify in this order

WMI provider → CIM/WMI query → data

Where it usually breaks

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

WMI · PowerShell operational reference

BoundaryWMI 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=5244

Confirmation

Confirm action

Continue?