PowerShell Version: get-host

 

The PowerShell version can be displayed with the get-host command.

For Windows, PowerShell is part of the operating system, so a PowerShell version is included for each OS version. The OS-integrated PowerShell version can be updated using WMF (Windows Management Framework). An overview of the PowerShell versions can be found on the following page: docs.microsoft.com

get-host

Example Windows 7 with PowerShell version 2 preinstalled:

Windows 10 ships with PowerShell version 5 or 5.1:

The result of get-host is also available as a variable: $host, i.e. we don't need to run the cmdlet, displaying the already filled variable is enough: 

the current PowerShell version is 7.4.2 (found: 2024-04-21)

$PSVersionTable

Since PowerShell version 2 there is additionally the variable $PSVersionTable:

Windows 7:

Windows 10:

 n7mdHopiAggbGrzeYT9MjNPHGRBuuhxMIouZW3Hp.png

Windows 11 also includes PowerShell version 5.1:

PS C:\Users\LiBe> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22000.282
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22000.282
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
positive Bewertung({{pro_count}})
Rate Post:
{{percentage}} % positive
negative Bewertung({{con_count}})

THANK YOU for your review!

Questions / Comments