Skip to content

How to Install and Update PowerShell 7

Windows PowerShell is installed on Windows systems by default. But that’s Windows PowerShell and not PowerShell. To make the most out of PowerShell, you should upgrade to PowerShell 7. In this article, you will learn how to install and update PowerShell 7.

Windows PowerShell vs PowerShell

There are two PowerShell versions that you need to be aware of:

  • Windows PowerShell (version 1.0 – 5.1)
    It’s preinstalled on all modern Windows client and server OS releases. It’s not being developed further, and the latest version is 5.1. The executable is powershell.exe.
  • PowerShell (version 6 and higher)
    It’s not preinstalled on any version of Windows. It’s actively being developed, is much faster, and has better commands available. The executable is pwsh.exe.

Note: You can have both Windows PowerShell and PowerShell versions installed next to each other on the same system.

PowerShell versions and release date

PowerShell has gone a long way since its first release. See the table below for all the PowerShell versions and their release date.

PowerShell versionRelease date
PowerShell 7.4November 2023
PowerShell 7.3November 2022
PowerShell 7.2November 2021
PowerShell 7.1November 2020
PowerShell 7March 2020
PowerShell 6.2March 2019
PowerShell 6.1September 2018
PowerShell 6.0January 2018
Windows PowerShell 5.1August 2016
Windows PowerShell 5.0February 2015
Windows PowerShell 4.0October 2013
Windows PowerShell 3.0October 2012
Windows PowerShell 2.0July 2009
Windows PowerShell 1.0November 2006

Find PowerShell version

To check which PowerShell version you are running, start Windows PowerShell or PowerShell as administrator and run the below command.

Note: Windows PowerShell and PowerShell are different versions and you need to start the correct PowerShell window and run the command below.

$PSVersionTable.PSVersion

This is how it looks if you run it in Windows PowerShell.

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      20348  1

See the screenshot below.

Install and Update PowerShell 7 check version Windows PowerShell

This is how it looks if you run it in PowerShell.

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7      4      0

See the screenshot below.

Install and Update PowerShell 7 check version PowerShell

Install PowerShell 7

There are different methods to install PowerShell on the system. Follow one of the methods below.

Method 1: One-liner

This is the fastest and easiest method to install PowerShell 7.

iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"

After that, you see the PowerShell 7 setup wizard that you can go through.

Install and Update PowerShell 7 setup

Ensure you enable all options.

Since PowerShell 7.2 and higher, Microsoft will automatically update PowerShell 7 in the same release channel if you enable it in the setup wizard. For example, PowerShell 7.2.x to 7.2.y and 7.3.x to 7.3.y.

Enable both options.

Install and Update PowerShell 7 Microsoft Update

Finish the installation.

PowerShell 7 appears in your programs.

Method 2. Download from GitHub

Go to the PowerShell GitHub page and download the PowerShell 7 installer.

Install and Update PowerShell 7 GitHub

Open the PowerShell .msi file and go through the setup wizard, as shown in the above method.

Method 3: WinGet (Windows Package Manager)

Run the below command to download and install PowerShell 7.

Note: It will automatically install PowerShell 7 once downloaded, and you will not see the setup wizard.

winget install --id Microsoft.Powershell

Update PowerShell 7

It’s best to update PowerShell 7 every time a new version is out.

Use the winget upgrade command to update PowerShell 7 to the latest version.

winget upgrade --id Microsoft.PowerShell

The other methods to upgrade PowerShell 7 are to download the installer from GitHub or run the one-liner as shown above, which then you can go through the setup wizard to update PowerShell.

Frequently Asked Questions (FAQ)

How to uninstall Windows PowerShell 5.1 on Windows after installing PowerShell 7?

You don’t. It’s integrated with Windows OS, and you must leave it on your system.

Why does Windows PowerShell ISE show version 5.1 when I have PowerShell 7 installed?

PowerShell ISE loads Windows PowerShell 5.1 and not PowerShell 7.

How can I keep using Windows PowerShell ISE with PowerShell 7?

Switch over to Visual Studio Code. It’s a free, lightweight, open-source, cross-platform code editor.

Will PowerShell 7 load automatically in Visual Studio Code?

PowerShell 7 takes precedence over Windows PowerShell 5.1 and loads by default.

Can I switch between Windows PowerShell 5.1 and PowerShell 7 in Visual Studio Code?

Select a default profile and choose Windows PowerShell 5.1 or PowerShell 7.

How can we know which cmdlets and modules are supported in PowerShell 7?

Microsoft keeps a release history of the modules and cmdlets.

Why doesn’t Microsoft ship PowerShell 7 with Windows?

Microsoft plans to eventually ship PowerShell 7 in Windows as a side-by-side feature with Windows PowerShell 5.1. But they still need to work out some details, and there is no timeline for when that will happen.

Should I use Windows PowerShell 5.1 or PowerShell 7?

You should definitely use PowerShell 7 when you can. But ensure you test all your cmdlets and scripts before transitioning to PowerShell 7.

Read more: How to connect to Microsoft Graph PowerShell »

Conclusion

You learned how to install and update PowerShell 7. Ensure that you use PowerShell 7 when you can because it’s kept up to date by Microsoft and performs much faster than the older versions. If it’s impossible to port some of your commands and scripts to PowerShell 7, then keep using PowerShell 5.1 for those.

Did you like this article? You may also like How to clear Microsoft Teams cache. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has One Comment

  1. You will have to keep in mind that PowerShell 7 might not be effective in your environment (I’m referring to Enterprise environment) like in my case, where PowerShell remoting is DISABLED by InfoSec which means you cannot use CIM but only WMI, the latter is deprecated and not available in PowerShell 7.
    I have an extensive collection of scripts and modules that I use in my environment but are written in Windows PowerShell.

Leave a Reply

Your email address will not be published. Required fields are marked *