Command to Check PowerShell Version

To check the PowerShell version, open a PowerShell console, type $PSVersionTable, and Press Enter.


You will see an output like the following:

check powershell version
PowerShell Version

In the above output, PSVersion is the PowerShell version. In this example, it is PowerShell version 7.

You can get just the value of the PSVersion property by typing the following command:


To get the version number without the header, type the following command:


The following three commands will return the Major, Minor, and Patch version, respectively:


Note that $PSVersionTable is not a command. It is a global variable that holds the information about PowerShell—We can check the value of a variable by just typing the name with the dollar sign ($) prefix.

get powershell version

Alternatively, you can also view the value of a variable using the Write-Output cmdlet:

Write-Output $PSVersionTable

Understanding Different PowerShell Versions

PowerShell 5.1 is the version that comes preinstalled on Windows 10, 11, and Server 2022. PowerShell 7 can run side-by-side with version 5.1.

You can click the link below for instructions on how to install PowerShell 7 on Windows:

How to Install PowerShell 7 on Windows

PowerShell 5.1 uses the powershell.exe process. PowerShell 7 uses the pwsh.exe process. That means if you execute a script using the PowerShell command, it will run on PowerShell 5.1.

To run a script on PowerShell 7, execute the script using the pwsh command.