Détermination installée Version PowerShell

Mots clés : powershellversionpowershell

meilleur 5 Réponses Détermination installée Version PowerShell

vote vote

98

PS C:\> $PSVersionTable.PSVersion  Major  Minor  Build  Revision -----  -----  -----  -------- 4      0      -1     -1 
vote vote

82

get-host  Name             : ConsoleHost Version          : 2.0 InstanceId       : d730016e-2875-4b57-9cd6-d32c8b71e18a UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface CurrentCulture   : en-GB CurrentUICulture : en-US PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy IsRunspacePushed : False Runspace         : System.Management.Automation.Runspaces.LocalRunspace  $PSVersionTable  Name                           Value ----                           ----- CLRVersion                     2.0.50727.4200 BuildVersion                   6.0.6002.18111 PSVersion                      2.0 WSManStackVersion              2.0 PSCompatibleVersions           {1.0, 2.0} SerializationVersion           1.1.0.1 PSRemotingProtocolVersion      2.1 
vote vote

75

1 >  $psversiontable  Name                           Value                                            ----                           -----                                            CLRVersion                     2.0.50727.4927                                   BuildVersion                   6.1.7600.16385                                   PSVersion                      2.0                                              WSManStackVersion              2.0                                              PSCompatibleVersions           {1.0, 2.0}                                       SerializationVersion           1.1.0.1                                          PSRemotingProtocolVersion      2.1     
vote vote

62

HKEY_LOCAL_MACHINE\Software\Microsoft\PowerShell\1\Install 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine\PowerShellVersion 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine\PowerShellVersion 
$isV2 = test-path variable:\psversiontable 
function Get-PSVersion {     if (test-path variable:psversiontable) {$psversiontable.psversion} else {[version]"1.0.0.0"} } 
vote vote

60

powershell -Command "$PSVersionTable.PSVersion" 
powershell -command "(Get-Variable PSVersionTable -ValueOnly).PSVersion" 

Questions similaires