How to upgrade PowerShell from Version 5.1 to 7

Share This

At the time of writing you cannot simply “upgrade” PowerShell from 5.1 to 7, you need to install PowerShell 7 alongside the your existing version. PowerShell 7 is a separate executable (pwsh.exe), and installing it won’t overwrite or remove PowerShell 5.1.

That being said it’s very easy to install and In this tutorial I’ll show you how you can do it step-by-step:


1. Check your current version

You can confirm your current PowerShell version by running the following CMDlet:

$PSVersionTable


2. Download PowerShell 7 Installer

You can download the latest version of PowerShell 7 from the official GitHub page:

  1. Go to PowerShell Releases.
  2. Look for the latest stable release (e.g., v7.4.6.).
  3. Download the correct installer for your system:
    • .msi for Windows Installer.
    • Choose the appropriate version (x64 for 64-bit systems or x86 for 32-bit systems).


3. Install PowerShell 7

  1. Run the .msi installer.
  2. Follow the installation wizard:
    • Accept the license agreement.
    • Choose the installation folder (default: C:\Program Files\PowerShell\).
    • Select the “Add PowerShell to PATH Environment Variable” option.
    • Choose whether to enable PowerShell remoting and create shortcuts.
  3. Complete the installation.


4. Verify the Installation

To verify the upgrade, open a new terminal (Command Prompt, old PowerShell, or Windows Terminal) and type:

pwsh

This will launch PowerShell 7 and confirm the version on opening, you can also use the CMDlet for full details.

$PSVersionTable


5. Set PowerShell 7 as Default

If you’d like to make PowerShell 7 the default shell in Windows Terminal or other tools:

  • Windows Terminal:
    1. Open Windows Terminal.
    2. Go to Settings > Profiles.
    3. Set the default profile to PowerShell 7.
  • For Shortcut:
    Update your PowerShell shortcut to point to pwsh.exe (located in C:\Program Files\PowerShell\7\pwsh.exe).


6. Using PowerShell 7 and 5.1 Together

  • PowerShell 7 (pwsh.exe) and Windows PowerShell 5.1 (powershell.exe) can coexist.
  • Use pwsh to launch PowerShell 7.
  • Use powershell to continue using PowerShell 5.1.

That’s it! PowerShell 7 is now installed and ready to use.

Did you enjoy this article?
Signup today and receive free updates straight in your inbox. We will never share or sell your email address.

Leave a Reply

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