How to Update PowerShell on Windows 11


A PowerShell logo on the Windows 11 default background.

If you check your PowerShell version and find it is out of date — or PowerShell has been helpfully reminding you that there is a new version available — you have a few options. Here is the best way to update PowerShell on Windows 11.

How to Update PowerShell

The best way to update PowerShell is through the command line, using winget.

Winget is a package manager introduced in Windows 10. Winget lets you download and install some programs from a centralized repository of programs rather than needing to track down an installer manually. It is a lot like apt on Debian-based Linux distros (like Ubuntu), dnf on Fedora, or pacman on Arch, if you’re familiar with those systems.

RELATED: How to Check the PowerShell Version on Windows 11

To download and install the update, open up a PowerShell tab in Terminal. Type or copy and paste the following command at the command line and press Enter. This command will download and install the latest version of PowerShell from Microsoft’s GitHub repository:

winget install --id Microsoft.Powershell --source winget

Note: That command downloads the latest stable PowerShell release. If you want the preview version of PowerShell — which is basically the open beta version — replace Microsoft.Powershell with Microsoft.PowerShell.Preview in the previous command.

Winget downloading a new version of PowerShell from GitHub.

Once the download and installation is finished, you should close all of your Terminal windows.

It is important to note that PowerShell 7.x won’t completely replace PowerShell 5.x when you install it on your system. Instead. PowerShell 7.x is installed in a separate location, and both versions of PowerShell remain usable on your PC.

When you launch Terminal after installing PowerShell 7.x, you’ll find that you now have an additional PowerShell profile available.

Two different versions of PowerShell available as profiles.

You can switch to the new version of PowerShell at any time by clicking the little chevron (a tailless down arrow) at the top of the window and selecting it from the drop-down menu. You could also change the default shell in Terminal to the latest version of PowerShell if you’d prefer that.

PowerShell differs significantly from Command Prompt and is much more powerful. If you have to spend any substantial amount of time manipulating Windows 10 or Windows 11 with a command-line interface, it is worth investing some time in learning to use PowerShell.

RELATED: Geek School: Learn How to Automate Windows with PowerShell





Source link