$psVersionTable
is an automatic variable (whose type is System.Collections.Hashtable
) that reveals some information about the PowerShell that runs the current session. $PSversionTable
… PS C:\> ($psVersionTable).psVersion Major Minor Build Revision ----- ----- ----- -------- 5 1 17763 134
get-host
: PS C:\> (get-host).version Major Minor Build Revision ----- ----- ----- -------- 5 1 17763 134
$psVersionTable
has some differing attributes: Attribute | PS | PS Core | Comments |
PSVersion | ✓ | ✓ | |
PSCompatibleVersions | ✓ | ✓ | |
PSEdition | Desktop | Core | Core still displayed in PowerShell 7 although PowerShell 7 dropped Core from its name. |
BuildVersion | ✓ | ✗ | |
GitCommitId | ✗ | ✓ | |
CLRVersion | ✓ | ✗ | |
WSManStackVersion | ✓ | ✓ | |
PSRemotingProtocolVersion | ✓ | ✓ | |
SerializationVersion | ✓ | ✓ | |
OS | ✗ | ✓ | |
Platform | ✗ | ✓ |