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.
安装
npx skills add microsoft/upgrade-agent-plugins --skill migrating-wmi-to-cimnpx skills add microsoft/upgrade-agent-plugins --skill migrating-wmi-to-cim -a claude-code -gnpx skills add microsoft/upgrade-agent-plugins --skill migrating-wmi-to-cim -a codex -ggemini skills install https://github.com/microsoft/upgrade-agent-plugins.git --path plugins/upgrade-agent/upgrade/dotnet/skills/lazy/pwsh/migrating-wmi-to-cimgh skill install microsoft/upgrade-agent-plugins migrating-wmi-to-cimgit clone --depth 1 https://github.com/microsoft/upgrade-agent-plugins /tmp/microsoft__upgrade-agent-plugins
mkdir -p ~/.claude/skills ~/.agents/skills
cp -R /tmp/microsoft__upgrade-agent-plugins/plugins/upgrade-agent/upgrade/dotnet/skills/lazy/pwsh/migrating-wmi-to-cim ~/.claude/skills/migrating-wmi-to-cim # Claude Code
cp -R /tmp/microsoft__upgrade-agent-plugins/plugins/upgrade-agent/upgrade/dotnet/skills/lazy/pwsh/migrating-wmi-to-cim ~/.agents/skills/migrating-wmi-to-cim # Codex, Cursor, Gemini CLI, Copilot, OpenCode