Upgrading PowerShell
Can't use a new PowerShell module? Make sure you have a current version of PowerShell.
You can upgrade PowerShell using WinGet, MSI Installer, or PowerShell commands. Here’s how:
Upgrade PowerShell Using WinGet (Recommended)
Open PowerShell as Administrator.
Run the following command:
winget install --id Microsoft.PowerShell --source winget
Follow the prompts to complete the installation.
Upgrade Using MSI Installer
Go to the official PowerShell installation page.
Download the latest MSI package for your system.
Run the installer and follow the setup instructions.
Upgrade Using PowerShell Script
Open PowerShell as Administrator.
Run:
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"
This script downloads and installs the latest version automatically.
After installation, restart PowerShell and check the version:
$PSVersionTable.PSVersion