Powershell

4 Ways to Check Your PowerShell Version

PowerShell is an automation tool capable of doing almost every task in Windows. Whenever Windows releases its update, it also comprises the latest PowerShell version. Currently, PowerShell has version 5.1. Knowing the PowerShell version helps you to know the features that you have access to. PowerShell has various commands that can help find the current version of it.

This tutorial will discuss four methods to retrieve the PowerShell version.

How to Check/Get the Version of Your PowerShell in 4 Ways?

These are the methods that can be applied to get the PowerShell version:

Method 1: Use the “Get-Host” Command to Check Your PowerShell Version

The “Get-Host” command outputs the current version of PowerShell as follows:

> Get-Host | Select-Object Version

Method 2: Use the “$PSVersionTable” Command to Check Your PowerShell Version

Another method that is really helpful to get the PowerShell version is executing the “$PSVersionTable” command:

> $PSVersionTable.PSVersion

It can be observed that the PowerShell version has been displayed in the PowerShell console.

Method 3: Use the “$Host.Version” Command to Check the Version of Your PowerShell

The “$Host.Version” is another method of retrieving the PowerShell version. The “$Host” is an automatic type of variable that displays the PowerShell version. It is quite similar to the “Get-Host” command:

> $Host.Version

Method 4: Use the Registry Key to Check Your PowerShell Version

Another way of getting the PowerShell version is by accessing a certain “Registry key” in PowerShell which is given below:

> (Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine -Name 'PowerShellVersion').PowerShellVersion

That was the four easiest methods for checking the PowerShell version on its console.

Conclusion

The PowerShell version can be checked using various ways. These methods include “Get-Host”, “$PSVersionTable”, “$Host.Version”, or “Registry Key”. All of these commands work in all versions of PowerShell. This write-up has discussed several ways to output the PowerShell version.

About the author

Muhammad Farhan

I am a Computer Science graduate and now a technical writer who loves to provide the easiest solutions to the most difficult problems related to Windows, Linux, and Web designing. My love for Computer Science emerges every day because of its ease in our everyday life.