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:
- Go to PowerShell Releases.
- Look for the latest stable release (e.g., v7.4.6.).
- 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
- Run the
.msi
installer. - 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.
- 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:
- Open Windows Terminal.
- Go to Settings > Profiles.
- Set the default profile to PowerShell 7.
- For Shortcut:
Update your PowerShell shortcut to point topwsh.exe
(located inC:\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.
#EdTech Network Manager, experienced in Microsoft 365, Server 2019, Intune, SCCM and anything inbetween.