brew upgrade powershell Or download the latest .pkg from the GitHub releases page. Using apt with Microsoft repository:
$PSVersionTable.PSVersion
choco upgrade powershell-core Using Homebrew (recommended):
# Update package list and upgrade PowerShell sudo apt update sudo apt upgrade powershell If not installed via repository, download the latest .deb from GitHub and run:
winget upgrade --id Microsoft.PowerShell