dotnet tool update --global PowerShell This method installs the latest PowerShell as a .NET global tool, ideal for developers who want version switching via dotnet tool . PowerShell 7 is the only version available for non-Windows.
# Update the Microsoft repository key and feed first sudo apt update sudo apt install powershell – Use the .pkg (macOS) or .deb/.rpm (Linux) from GitHub releases.
# Old Windows PowerShell powershell -Command "$PSVersionTable.PSVersion" pwsh -Command "$PSVersionTable.PSVersion" 8. Troubleshooting Common Upgrade Issues Issue: “pwsh is not recognized” Solution: Add C:\Program Files\PowerShell\7 to your system PATH or reinstall using MSI with “Add to PATH” checked. how to upgrade powershell
After upgrade, verify with pwsh --version . This is the most common “upgrade” scenario for Windows users. No direct in-place upgrade exists, but you can migrate.
Always test critical scripts in PowerShell 7 before fully migrating. And remember – upgrading doesn’t mean losing the old version. You can safely run both and choose the right tool for the job. dotnet tool update --global PowerShell This method installs
PowerShell has evolved significantly from a Windows-only administration tool into a cross-platform automation framework. If you’re still using Windows PowerShell 5.1, you’re missing out on performance improvements, new operators, ForEach-Object -Parallel , and seamless integration with modern DevOps tools.
For macOS/Linux: ( brew upgrade powershell / apt upgrade powershell ). This is the most common “upgrade” scenario for
To see both your old and new versions: