For the Windows operating system, which includes Windows XP (SP2), Windows Server 2003 (r2 SP1), and Windows Vista, PowerShell 1.0 was published in 2006. It is a component of the.NET framework and includes the PowerShell ISE, a graphical software.
Knowing how to check your PowerShell version is helpful whether you are an experienced PowerShell user or just getting started. In this guide, we’ll show you how to accomplish that.
How to Check the PowerShell Version in Windows 10
Most Windows 10 versions have Powershell 5.1. The version of PowerShell 7 (which is the latest version of PowerShell) that is typically installed on Windows 10 computers is different from this one. Download the installation file or execute a PowerShell command on your computer to install this version of PowerShell.
- $PSVersionTable.PSVersion Cmdlets
- (Get-Host).Version command line
- $host.Version property
- Registry (Windows PowerShell only)
1. $PSVersionTable.PSVersion Cmdlets
Knowing your PowerShell version allows you to know which capabilities are available to you. We’ll demonstrate how to use a PowerShell command that shows the version number.
In addition to returning the PowerShell version, the $PSVersionTable command also returns the ‘Edition’. By the way, this command will also let you know if PowerShell Core or PowerShell Desktop is currently executing.
To find the version number, utilize the PowerShell tool itself.
- Start by selecting the “Start” menu, typing “Windows PowerShell,” and then selecting the result from the search.
- Type the following command and hit Enter in the PowerShell window that appears:
- Your PowerShell version is the first value listed under the “PSVersion” field, in the above example it is 5.1.
2. (Get-Host).Version command line
Hosts are a concept in PowerShell. A program hosting the PowerShell engine is referred to as a host. The PowerShell engine itself is not the issue. PowerShell hosts include a code editor with a built-in terminal or the PowerShell console.
- An entirely separate version of PowerShell may exist on a host.
- You can see that (Get-Host).Version gives a version number that appears to be the PowerShell engine version if you run it.
- The version may not always match when running Get-Host in an integrated terminal.
- Although the host often represents the same version of the engine, this is not always the case.
3. $host.Version property
Citing the $host.Version can also be used to determine the Powershell version. A built-in variable called $host produces the same results as Get-Host.
This approach has nothing unique about it. Simply put, it’s the same as using Get-Host.
4. Registry (Windows PowerShell only)
You can also check the registry if you don’t want to launch PowerShell. The registry key path has a value beneath which the PowerShell version is hidden:
You can use Get-ItemProperty to refer to the PowerShellVersion value that is contained in this registry entry.
As you can see, this version is comparable to the others but does not have the revision.
How can I install the latest version of PowerShell in Windows?
You may install a more modern and safe version of PowerShell using a couple of the techniques I’ll outline for you.
1. Shop Microsoft
You can easily search for PowerShell in the Microsoft Store on Windows 10 and Windows 11. just download the installer in your system and install the latest version of PowerShell.
From your preferred command line/terminal, you can get the most recent version using the package manager WinGet.
The winget command can download PowerShell from a variety of sources, including the Microsoft Store (msstore) and “winget.” I specify “winget” with the “-s” option.
3. The information highway
You can get different PowerShell package types by browsing the Microsoft Docs website.