Determine installed PowerShell version

2018-12-31 22:59发布

How can I determine what version of PowerShell is installed on a computer, and indeed if it is installed at all?

标签: powershell
25条回答
春风洒进眼中
2楼-- · 2018-12-31 23:40

You can also call the "host" command from the PowerShell commandline. It should give you the value of the $host variable.

查看更多
余生无你
3楼-- · 2018-12-31 23:42

To check if PowerShell is installed use:

HKLM\Software\Microsoft\PowerShell\1 Install ( = 1 )

To check if RC2 or RTM is installed use:

HKLM\Software\Microsoft\PowerShell\1 PID (=89393-100-0001260-00301) -- For RC2
HKLM\Software\Microsoft\PowerShell\1 PID (=89393-100-0001260-04309) -- For RTM

Source: this website.

查看更多
情到深处是孤独
4楼-- · 2018-12-31 23:43

Extending the answer with a select operator:

Get-Host | select {$_.Version}
查看更多
与君花间醉酒
5楼-- · 2018-12-31 23:43

Usually you get it using the Major number that you can get like this:

$PSVersionTable.PSVersion.Major
查看更多
墨雨无痕
6楼-- · 2018-12-31 23:43

Try ;) ((Get-Host).Version).Major

查看更多
骚的不知所云
7楼-- · 2018-12-31 23:44

Command $PSVersionTable.PSVersion is helpfull.

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
6      1      0
查看更多
登录 后发表回答