While the command ver could get you the version info on a command prompt, and winver does it in the GUI, if you're stumbling to find the command to get the version number of Windows PowerShell installed on your computer (like I did for a while), it is Get-Host.
Perhaps adding an alias for ver so it works out of the box would've been a good idea folks... ! :)
To add the alias: new-alias ver get-host
Perhaps adding an alias for ver so it works out of the box would've been a good idea folks... ! :)
To add the alias: new-alias ver get-host
Labels: Exchange Shell

Exchangepedia Blog is read by visitors from all 50 US States and 150 countries world-wide


7 Comments:
or you can type $host. there's lots of interesting variables, try get-variable and it will show you all.
$env:psver = $host.version.tostring()
One small point I discovered today. This is the version of the HOST, not of PowerShell itself. When run from, say the PowerShell prompt, it is indeed the same version. But if you run this command from the PowerShell Plus prompt, you get a different value (ie the version of the host, or of PowerShell Plus itself).
As we move forward into PowerShell Version 2, this distinction becomes more important.
>$PSVersionTable
Name Value
---- -----
CLRVersion 2.0.50727.3082
BuildVersion 6.1.6949.0
PSVersion 2.0
PSCompatibleVersions {1.0, 2.0}
Thanks, that was very useful information.
thx
Thanks! I was at a loss as to why I did not have PS 2.0 on my WIN7 machine. Of course now that I know how to check the version, I know its 2.0. Life is normal once again.
Post a Comment
Links to this post:
Create a Link
<< Home