4 Ways to Check Your PowerShell Version
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:
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:
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:
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:
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.
Source: linuxhint.com