microsoft/upgrade-agent-plugins/migrating-wmi-to-cim
Claude Code and agent skill by microsoft/upgrade-agent-plugins
- vendor
Checking that the SKILL.md file is still in the repository.
Migrate removed WMI cmdlets and type accelerators to CIM in PowerShell 7.x: Get-WmiObject → Get-CimInstance, Invoke-WmiMethod → Invoke-CimMethod, Remove-WmiObject → Remove-CimInstance, Register-WmiEvent → Register-CimIndicationEvent, and [wmi]/[wmiclass]/[wmisearcher] accelerators. Use during the powershell-51-to-7-upgrade scenario for the WMI blocker bucket.
Install
npx vskill@latest install microsoft/upgrade-agent-plugins/migrating-wmi-to-cimSKILL.md
The same SKILL.md was published earlier as microsoft/upgrade-agent-plugins/migrating-wmi-to-cim.
WMI → CIM Migration (PowerShell 7.x)
All *-WmiObject/*-Wmi* cmdlets and the [wmi*] type accelerators are removed in PowerShell 7. Migrate to the CIM cmdlets (CimCmdlets module, shipped in-box).
Cmdlet mapping
| Windows PowerShell 5.1 | PowerShell 7.x | |
|---|---|---|
Get-WmiObject -Class X | Get-CimInstance -ClassName X | |
Get-WmiObject -Query "..." | Get-CimInstance -Query "..." | |
Invoke-WmiMethod | Invoke-CimMethod | |
Set-WmiInstance | Set-CimInstance / New-CimInstance | |
Remove-WmiObject | Remove-CimInstance | |
Register-WmiEvent | Register-CimIndicationEvent | |
[wmi]"path" | Get-CimInstance by key | |
[wmiclass]"class" | Get-CimClass / Invoke-CimMethod | |
[wmisearcher]"query" | Get-CimInstance -Query |
Key differences (do not do a blind rename)
- `-Class` → `-ClassName`. The parameter name changed.
- Return type differs. CIM returns
Microsoft.Management.Infrastructure.CimInstance,
not System.Management.ManagementObject. Downstream property access usually works, but:
- Method invocation changes:
$obj.SomeMethod($a)(WMI) →
Invoke-CimMethod -InputObject $obj -MethodName SomeMethod -Arguments @{ Param = $a }.
DateTimeand some enums render differently — verify consumers.
- Remote access.
-ComputerNameon WMI used DCOM. CIM defaults to
WSMan; for DCOM-only targets create a session: ``powershell $opt = New-CimSessionOption -Protocol Dcom $s = New-CimSession -ComputerName $c -SessionOption $opt Get-CimInstance Win32_Service -CimSession $s ``
- Filtering.
-Filter "Name='x'"works on both; prefer it over
client-side Where-Object for performance.
Example
Validation (Rung 4b)
WMI→CIM is read-mostly and best validated by diffing the selected properties actually consumed, not raw objects:
Record read-only-diff-clean when the consumed properties match.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 21 Oct 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/upgrade-agent/upgrade/dotnet/skills/lazy/pwsh/migrating-wmi-to-cim/SKILL.md
Popularity
- Repository stars
- 42
- Repository forks
- 10
- 7-day trend score
- 5
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/upgrade-agent-plugins/migrating-wmi-to-cim)