Get PowerShell version in a Windows system
Ways to get PowerShell version in a Windows system
- $PSVersionTable.PSVersion (Available in PS version 2 or higher)
- get-host (For PS version 1)
- powershell -Command "$PSVersionTable.PSVersion" <- command="" from="" li="" prompt="" run=""> ->
- 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
Post a Comment