PowerShell view current version, Windows version,. NET version information
There are a number of cmdlet or cmdlet parameters that are not supported in different versions of PowerShell. Therefore, it is very important to find out the current version of PowerShell information. So how do you view the current PowerShell version information? Hongo to introduce two methods:
is actually two PowerShell environment variables, one is $psversiontableand the other is $host.
There are a number of cmdlet or cmdlet parameters that are not supported in different versions of PowerShell. Therefore, it is very important to find out the current version of PowerShell information. So how do you view the current PowerShell version information? Hongo to introduce two methods:
is actually two PowerShell environment variables, one is $psversiontable, the other is $host.
First look at the $psversiontable, this variable to take apart to see is ps-version-table, represents the PowerShell of the various components of the version number list. Which represents PowerShell's own version number (psversion), also included. NET version number (clrversion), as well as the Windows version number (buildversion), the other is not one by one number, in fact, not fully understand, hehe.
PS c:\users\zhanghong> $psversiontable
Name Value
---- -----
Clrversion 2.0.50727.4984
Buildversion 6.1.7600.16385
Psversion 2.0
Wsmanstackversion 2.0
Pscompatibleversions {1.0, 2.0}
Serializationversion 1.1.0.1
Psremotingprotocolversion 2.1
Next look at the $host variable, which is a version, which represents the PowerShell number.
PS c:\users\zhanghong> $host
Name:consolehost
version:2.0
Instanceid:38d7558e-1810-446d-a81c-41fb6d40ac13
UI:System.Management.Automation.Internal.Host.InternalHostUserI
Nterface
Currentculture:zh-cn
Currentuiculture:zh-cn
Privatedata:microsoft.powershell.consolehost+consolecolorproxy
Isrunspacepushed:false
Runspace:System.Management.Automation.Runspaces.LocalRunspace