Upgrade Windows PowerShell 5.1 scripts (.ps1/.psm1/.psd1) to cross-platform PowerShell 7.x. Use when the user asks to upgrade PowerShell scripts, move off Windows PowerShell 5.1, migrate WMI to CIM, remove PSSnapins, or make scripts run on PowerShell 7 / pwsh.
安装
npx skills add microsoft/upgrade-agent-plugins --skill powershell-51-to-7-upgradenpx skills add microsoft/upgrade-agent-plugins --skill powershell-51-to-7-upgrade -a claude-code -gnpx skills add microsoft/upgrade-agent-plugins --skill powershell-51-to-7-upgrade -a codex -ggemini skills install https://github.com/microsoft/upgrade-agent-plugins.git --path plugins/upgrade-agent/upgrade/dotnet/skills/scenarios/powershell-51-to-7-upgradegh skill install microsoft/upgrade-agent-plugins powershell-51-to-7-upgradegit 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/scenarios/powershell-51-to-7-upgrade ~/.claude/skills/powershell-51-to-7-upgrade # Claude Code
cp -R /tmp/microsoft__upgrade-agent-plugins/plugins/upgrade-agent/upgrade/dotnet/skills/scenarios/powershell-51-to-7-upgrade ~/.agents/skills/powershell-51-to-7-upgrade # Codex, Cursor, Gemini CLI, Copilot, OpenCode