Windows 10, 11 DisplayVersion (22H2, 21H2 usw.)

Inhaltsverzeichnis

Frage: Wie kann ich die Windows Displayversion der Geräte ermitteln?

Antwort:

Mit diesem Powershell-Skript kann die Display Version von Windows aus der Registry des jeweiligen Gerätes ermittelt werden.

Hinweis: Bitte nur den Code zwischen den ‘<snip>’-Tags kopieren. Das Skript kann in der Skriptbibliothek der River als Job-Skript verwendet werden.

=> Microsoft Windows Versionen <=

Skript-Code #

<snip>

$regPath = “HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion”
$regKey= “DisplayVersion”

$displayVersion = (Get-ItemProperty $regPath -Name $regKey).$regKey
$osBuild = (Get-WmiObject Win32_OperatingSystem).BuildNumber

$valid_osBuild_10 = @( 19045, 19044, 19043, 19042, 19041, 18363, 18362, 17763, 17134, 16299, 15063, 14393, 10586, 10240 )
$valid_osBuild_11 = @( 22621, 22000 )

$cr_lf = “`r`n”

if ($osBuild) {

foreach ($build_10 in $valid_osBuild_10) {

if ($build_10 -ge $osBuild) {

$output = “Windows 10” + $cr_lf + “OS Build: $osBuild” + $cr_lf + “Display Version: < $displayVersion >” + $cr_lf + “Update to Windows 11 possible”
Write-Host $output
exit 0

}

else {

# This code should never execute.
$output = “No Windows 10 Release detected”
Write-Host $output
exit 1

}

}

foreach ($build_11 in $valid_osBuild_11) {

if ($build_11 -ge $osBuild) {

$output = “Windows 11” + $cr_lf + “OS Build: $osBuild” + $cr_lf + “Display Version: < $displayVersion >” + $cr_lf + “Already on Windows 11”
Write-Host $output
exit 0

}

else {

# This code should never execute.
$output = “No Windows 11 Release detected”
Write-Host $output
exit 1

}

}

}

exit 0

<snip>

Skript-Ausgabe #

Abb. 1

High Quality Theme

There is a fine line between creating greatness and accomplishing awesomeness. This time, we worked to prove that sky is not the limit.

Fill out the form to subscribe to our newsletter.

[contact-form-7 404 "Nicht gefunden"]

High Quality Theme

There is a fine line between creating greatness and accomplishing awesomeness. This time, we worked to prove that sky is not the limit.

Fill out the form to subscribe to our newsletter.

[contact-form-7 404 "Nicht gefunden"]