Récupérer l'information ReleaseID via une intérogration dans la base de registre de Windows 10, merci à David pour cette trouvaille
$ReleaseId = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId $ReleaseIdRésultat :
# Version Intégrale ([System.Environment]::OSVersion.Version).ToString() # Build uniquement ([System.Environment]::OSVersion.Version.Build).ToString() # Information Major ([System.Environment]::OSVersion.Version.Major).ToString()Résultat :
[string]$Version = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ReleaseId
$Edition = switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
{
10240 { '1507' }
10586 { '1511' }
14393 { '1607' }
15063 { '1703' }
16299 { '1709' }
17134 { '1803' }
17763 { '1809' }
18362 { '1903' }
18363 { '1909' }
19041 { '2004' }
19042 { '20H2' }
19043 { '21H1' }
21390 { '21H2' }
default { 'Unknown' }
}
$Edition
& C:\Windows\System32\control.exe /name Microsoft.WindowsUpdate
$Wmi_OS = Get-CimInstance -ClassName "Win32_OperatingSystem" -Namespace "root\CIMV2" $GetMUILanguages = $Wmi_OS.MUILanguages