Get-WinVer

#Created by Michael J. Thomas
#Last Updated 8/12/2022

 
Function Get-WinVer {

Param

(

$ComputerName

)

$WinVer = (get-wmiobject win32_operatingsystem -ComputerName $ComputerName).Version

#Threshold 1 10240
#Threshold 2 10586
#Redstone 1 14393
#Redstone 2 15063
#Redstone 3 16299[h]
#Redstone 4 17134
#Redstone 5 17763
#19H1 18362
#19H2 18363
#20H1 19041
#20H2 19042
#21H1 19043
#21H2 19044
#22H2   19045

Switch ($WinVer){

"10.0.10240"{"Windows 10 Threshold 1"}
"10.0.10586"{"Windows 10 Threshold 2"}
"10.0.14393"{"Windows 10 Redstone 1"}
"10.0.15063"{"Windows 10 Redstone 2"}
"10.0.16299"{"Windows 10 Redstone 3"}
"10.0.17134"{"Windows 10 Redstone 4"}
"10.0.17763"{"Windows 10 Redstone 5"}
"10.0.18362"{"Windows 10 19H1"}
"10.0.18363"{"Windows 10 19H2"}
"10.0.19041"{"Windows 10 20H1"}
"10.0.19042"{"Windows 10 20H2"}
"10.0.19043"{"Windows 10 21H1"}
"10.0.19044"{"Windows 10 21H2"}
"10.0.19045"{"Windows 10 22H2"}

}

}

Example: Get-WinVer -ComputerName "Computer01"
Return Result PS C:\Windows> Windows 10 21H2


Comments

Popular posts from this blog

Add-RemoteDesktopUsers

Invoke-Reprofile

Mike's Profile Cleanup Tool