There are many features that may only work in a specific PowerShell version. As a PowerShell administrator, you should know the exact version of PowerShell installed in the OS before running any script. In this tutorial, I will explain how to check the PowerShell version using several methods.
To check the PowerShell version in the Windows operating system, you can run this command: $PSVersionTable.PSVersion. This will work on Windows 11, Windows 10, and other operating systems.
There are also other methods you can use to check the PowerShell version.
Check PowerShell Version
Now, let me show you how to get the PowerShell version using different methods. Follow this along with the examples.
Method 1: Using $PSVersionTable
To check your PowerShell version, you can use the universal command: $PSVersionTable.
When you run this command, PowerShell displays a table with detailed version information, including PSVersion, PSEdition, GitCommitId, OS details, and more. This works in all PowerShell versions and across Windows, Linux, and macOS.
If you want just the version number without all the additional information, you can use:
$PSVersionTable.PSVersionYou can see the screenshot below. I executed the above command using VS code. It shows me the PowerShell version.

Sometimes you only need to know if you’re running PowerShell 5, 6, or 7 for basic compatibility checks. In these cases, you can get just the major version number by directly selecting it:
$PSVersionTable.PSVersion.MajorThis command returns only the major version number (like 5 or 7).
Check out Run PowerShell Script From Command Line With Parameters
Method 2: Using Get-Host
The Get-Host cmdlet provides information about the current host program, including the version of PowerShell.
Get-HostThe output is shown in the screenshot below. It provides a lot of information, including the PowerShell version. This time, I executed the script using Windows PowerShell ISE.
Name : Windows PowerShell ISE Host
Version : 5.1.22621.2506
InstanceId : aaa160fc-9465-4e39-84aa-2737f3b88c08
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-IN
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.Host.ISE.ISEOptions
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspaceHere, the Version property indicates the PowerShell version.

Check out PowerShell Naming Conventions & Best Practices
Method 3: Using Get-Command
You can also use the PowerShell Get-Command cmdlets to get the PowerShell version. Below is the complete command.
(Get-Command powershell).VersionMethod 4: Checking the Registry (Windows Only)
If you have knowledge about the Windows Registry, you can also check the PowerShell version there.
Here are the steps:
- Press
Win + R, typeregedit, and press Enter to open the Registry Editor. - Navigate to the following path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine - Look for the
PowerShellVersionentry, which will display the version.
Method 5: Using PowerShell Core on Linux or macOS
If you are using PowerShell Core on Linux or macOS, you can check the version using the pwsh command.
Here are the steps:
- Open Terminal.
- Type the following command and press Enter:
pwsh --version - The terminal will display the PowerShell version:
PowerShell 7.4.0
Conclusion
In this tutorial, I have explained different methods to get the PowerShell version:
- Using $PSVersionTable
- Using Get-Host
- Using Get-Command
- Checking the Registry (Windows Only)
- Using PowerShell Core on Linux or macOS
You may also like:
- Create an Empty Array in PowerShell
- PowerShell Do-Until Loop Examples
- Associative Arrays in PowerShell
Bijay Kumar is an esteemed author and the mind behind PowerShellFAQs.com, where he shares his extensive knowledge and expertise in PowerShell, with a particular focus on SharePoint projects. Recognized for his contributions to the tech community, Bijay has been honored with the prestigious Microsoft MVP award. With over 15 years of experience in the software industry, he has a rich professional background, having worked with industry giants such as HP and TCS. His insights and guidance have made him a respected figure in the world of software development and administration. Read more.