How to Check Which PowerShell Version You Have on Windows 11

Watch the video on YouTube
▶ Watch the video on YouTube

Some scripts and modules need a specific version of PowerShell. Checking which one you have takes a few seconds, and it also explains why Windows sometimes seems to have two different PowerShells.

Check the PowerShell version with one command

  1. Right-click the Start button and choose Terminal, or search for PowerShell in the Start menu.
  2. Type this command and press Enter:
$PSVersionTable

Look at the PSVersion line. If you only want the version number, use:

$PSVersionTable.PSVersion

The output shows Major, Minor, Build and Revision numbers. For example, Major 5 and Minor 1 means Windows PowerShell 5.1.

Windows PowerShell 5.1 vs PowerShell 7

  • Windows PowerShell 5.1 comes built into Windows 10 and 11. Its program is powershell.exe. It still gets security fixes but no new features.
  • PowerShell 7 is the newer, cross-platform version. It installs separately, runs as pwsh.exe, and sits side by side with 5.1.

Running $PSVersionTable inside each one shows its own version, so check in the window you actually use for your scripts.

How to install or update PowerShell 7

  1. Open Terminal or Command Prompt.
  2. Run this command to install the latest stable version with winget:
winget install --id Microsoft.PowerShell --source winget

To update later, run winget upgrade --id Microsoft.PowerShell. You can also install it from the Microsoft Store by searching for PowerShell.

After installing, open Windows Terminal, click the down arrow next to the tabs, and pick PowerShell (not Windows PowerShell) to use version 7.

Check the version without opening PowerShell

From Command Prompt, you can ask PowerShell for its version directly:

powershell -NoProfile -Command "$PSVersionTable.PSVersion"

To check PowerShell 7 the same way, replace powershell with pwsh. If Command Prompt says pwsh is not recognized, PowerShell 7 isn’t installed.

Frequently asked questions

Will installing PowerShell 7 break my old scripts?

No. PowerShell 7 does not replace Windows PowerShell 5.1. Both stay installed, so older scripts can still run in 5.1 if they need it.

Is there another way to see the version?

Yes. Running Get-Host shows a Version line, but that is the version of the host program. $PSVersionTable.PSVersion is the most reliable check.

Leave a Comment

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