Powershell Mechanical Fixups

Apply low-risk, deterministic PowerShell 5.1 → 7.x fixes across scripts: '-Encoding Byte' → '-AsByteStream', hardcoded 'powershell.exe' → 'pwsh', removing 'New-WebServiceProxy', bumping '#Requires -Version 5' / dropping '-PSEdition Desktop', pinning explicit '-Encoding' on file writes (the default changed to UTF-8 no-BOM in PS7), and rewriting fragile '$x -eq $null' to '$null -eq $x'. Use during the powershell-5.1-to-7-upgrade scenario's execution stage to clear the AutoFix-severity findings before tackling architectural blockers.

Microsoft 89fc007 6.1 KB Updated 2.7k repo stars

File contents

microsoft/upgrade-agent-plugins/tree/main/plugins/upgrade-agent/upgrade/dotnet/skills/lazy/pwsh/powershell-mechanical-fixups commit 89fc007751

Frequently asked questions

npx skillmds@latest add microsoft/powershell-mechanical-fixups