Get PowerShell version in a Windows system

Ways to get PowerShell version in a Windows system



  1. $PSVersionTable.PSVersion (Available in PS version 2 or higher)
  2. get-host (For PS version 1)
  3. powershell -Command "$PSVersionTable.PSVersion" <- command="" from="" li="" prompt="" run="">
  4. powershell -command "(Get-Variable PSVersionTable -ValueOnly).PSVersion" <- command="" from="" li="" prompt="" run="">

Outputs:


$PSVersionTable.PSVersion Major Minor Build Revision ----- ----- ----- -------- 3 0 -1 -1




get-host Name : ConsoleHost Version : 3.0 InstanceId : 9b7e8224-e1d5-4b22-b0cb-53f19cd9c5b8 UI : System.Management.Automation.Internal.Host.InternalHostUserInterface CurrentCulture : en-US CurrentUICulture : en-US PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy IsRunspacePushed : False Runspace : System.Management.Automation.Runspaces.LocalRunspace

Comments

Popular posts from this blog

vRA/vRO workflows

How to generate HPS Report for Windows