Depending on your Operating System and how updated it is you will have a certain PowerShell version in the system.
A PowerShell version contains three or four numbers separated by periods (.) that represent the Major version number, the Minor version number, the Build number, and the Revision number (optionally).
Microsoft integrates new features inside PowerShell while improving the current ones on each successive build or version. Some editions also remove certain outdated cmdlets, so you may only use those in the previous builds.
As such, it’s best if you know what version of PowerShell you have, especially if you are getting into PowerShell scripts. This way, you’ll better understand what functionalities or cmdlets to include and what to exclude in your codes or scripts.
Current PowerShell Editions and Versions
Microsoft usually bundles a specific edition of PowerShell in its installation software, which is called Windows PowerShell. For instance, these were the PowerShell versions during the initial launch of the following Windows builds:
Regularly updating Windows will install the necessary .NET Framework and Windows Management Framework on all these systems and update the Windows PowerShell to the latest version (5.1).
But Microsoft has continued developing PowerShell and released further editions even though they are not bundled together with the Windows Operating System. These builds are commonly calledPowerShell Coreto differentiate them from Windows PowerShell. However, you will usually see them as PowerShell 6.x or PowerShell 7.x.
You need to download and install the latest PowerShell versions separately to get them in your system. Microsoft providesmany methods to install this application, but they may install the program in different locations. So, it’s best to keep using the same method when installing any future versions or builds as well.
How to Check the PowerShell Version?
You should already have a tentative estimate of the version while opening the program itself.
In Windows 10 and 11, the PowerShell command on Run opens Windows Powershell (version 5) while you need to use thepwshcommand to open PowerShell Core (v6 or v7). Searching PowerShell on the Search bar (Win + S) also lists Windows PowerShell, PowerShell 7, and so on.
PowerShell Core also shows the version number on the top after you open it. But you will need to run some cmdlets inside Windows PowerShell to know the full version. you may also get this information from the corresponding registry entries.
Using $PSVersionTable Cmdlet
$PSVersionTableis the best cmdlet to check the current PowerShell version. It will show all the version information, including the version number in a table format.