WizardKit/.bin/Scripts/os_check.ps1
Alan Mason 3031df5a4c 2016-07: Retroactive Updates
* DISM
  * Much safer WinVer check

* Enter / Exit SafeMode
  * Now enables MSI (un)installers in SafeMode w/ Networking

* Final Checklist
  * NEW: can now be run directly from UFD

* Hide Windows 10 Upgrade.reg
  * Added more registry blocks

* Removed Chocolately
  * Too much volatility
  * Ninite will regain default installer status

* Replaced ConEmu with Cmder
  * Cmder has a heavily modified ConEmu
  * Changed background
  * Added Cmder launchers in Misc

* SW Diagnostics
  * NEW: can now be run directly from UFD
  * BleachBit / Winapp2.ini updated
    * Expanded selections
    * Now only checks temp data size; DOES NOT delete temp data
  * Internet connection test will now loop until the manually exited
  * Now warns you that it can't check Windows activation in SafeMode

* Bugfixes
  * reset_browsers.ps1
    * Should skip "resetting" the backup folders (i.e. Default.wkbak)
2017-11-17 00:50:54 -07:00

62 lines
1.6 KiB
PowerShell

# WK-OS Check
#
# 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 -match "10240") {
$win_version = "10"
} elseif ($win_info.CurrentBuildNumber -match "10586") {
$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 ==
# 6.3.10240
# === 10 v1511 ==
# 6.3.10586
$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"
}
# 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'
}