Automation · PowerShell Automation
WMI
Cheat sheet · https://pcornel.dk/topic.php?topic=5244
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 classeswinmgmt /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
| Boundary | WMI reference |
|---|---|
| Runtime identity | PowerShell edition/version + command/module source |
| Persistent intent | Script/module/config prerequisites under source control |
| Verification | Read-only discovery → execution evidence → independent target read-back |
| Output contract | Structured objects/streams before formatting |
| Failure boundary | Separate 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