# Wizard Kit: Set some OS specific variables. $win_info = gp hklm:"\SOFTWARE\Microsoft\Windows NT\CurrentVersion" if ($win_info.CurrentVersion -match "6.0") { $win_version = "Vista" } elseif ($win_info.CurrentVersion -match "6.1") { $win_version = "7" } elseif ($win_info.CurrentVersion -match "6.2") { $win_version = "8" } elseif ($win_info.CurrentVersion -match "6.3") { if ($win_info.CurrentBuildNumber -match "9200") { $win_version = "8" } elseif ($win_info.CurrentBuildNumber -match "9600") { $win_version = "8" } elseif ($win_info.CurrentBuildNumber -ge "10240") { $win_version = "10" } } $arch = (gci env:processor_architecture).value $arch = $arch -ireplace 'x86', '32' $arch = $arch -ireplace 'AMD64', '64' #$win_info.CurrentBuild # == vista == # 6.0.6000 # 6.0.6001 # 6.0.6002 # ==== 7 ==== # 6.1.7600 # 6.1.7601 # 6.1.7602 # ==== 8 ==== # 6.2.9200 # === 8.1 === # 6.3.9200 # === 8.1u == # 6.3.9600 # === 10 v1507 "Threshold 1" == # 6.3.10240 # === 10 v1511 "Threshold 2" == # 6.3.10586 # === 10 v1607 "Anniversary Update" "Redstone 1" == # 6.3.14393 # === 10 v____ "Redstone 2" == # 6.3. $os_name = $win_info.ProductName $os_name += " " + $win_info.CSDVersion $os_name = $os_name -replace 'Service Pack ', 'SP' if ($win_info.CurrentBuild -match "9600") { $os_name += " Update" } elseif ($win_info.CurrentBuild -match "10586") { $os_name += " Release 1511" } elseif ($win_info.CurrentBuild -match "14393") { $os_name += " Release 1607 Anniversary Update" } # Get activation status if ($safemode) { $win_act = " Activation status unavailable in safe mode" } else { $slmgr = (gci env:windir).value + "\System32\slmgr.vbs" $win_act = (cscript /nologo $slmgr /xpr) -imatch '^\s' }