PowerShell to view the current version, Windows version,. NET version information of the code _powershell

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.