From c9fece25c7603ad969a664196979eafbd4956633 Mon Sep 17 00:00:00 2001 From: Bryan Cerrati Date: Thu, 26 Jun 2025 13:21:49 -0400 Subject: [PATCH] init --- upgradechecker.ps1 | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 upgradechecker.ps1 diff --git a/upgradechecker.ps1 b/upgradechecker.ps1 new file mode 100644 index 0000000..aebe530 --- /dev/null +++ b/upgradechecker.ps1 @@ -0,0 +1,68 @@ +# Require admin rights +If (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(` + [Security.Principal.WindowsBuiltinRole]::Administrator)) { + Write-Error "Please run this script as Administrator." + exit +} + +$results = @{} + +# CPU Check (existence assumed OK for this test) +$cpu = Get-WmiObject Win32_Processor +$results["CPU Present"] = $true + +# RAM Check +$ram = [math]::Round((Get-WmiObject Win32_ComputerSystem).TotalPhysicalMemory / 1GB, 2) +$results["RAM >= 4GB"] = $ram -ge 4 + +# TPM Check +try { + $tpm = Get-WmiObject -Namespace "Root\CIMv2\Security\MicrosoftTpm" -Class Win32_Tpm -ErrorAction Stop + $results["TPM Present"] = $tpm.TpmPresent + $results["TPM Ready"] = $tpm.SpecVersion -match "2\.0" +} catch { + $results["TPM Present"] = $false + $results["TPM Ready"] = $false +} + +# Partition Style +try { + $disk = Get-Disk | Where-Object { $_.IsSystem -eq $true } + $results["Disk is GPT"] = $disk.PartitionStyle -eq 'GPT' +} catch { + $results["Disk is GPT"] = $false +} + +# Boot Mode +try { + $firmware = Get-WmiObject -Class Win32_ComputerSystem + $results["UEFI Boot"] = $firmware.BootupState -like "*UEFI*" +} catch { + $results["UEFI Boot"] = $false +} + +# Secure Boot (Optional) +try { + $sb = Confirm-SecureBootUEFI -ErrorAction Stop + $results["Secure Boot Enabled"] = $sb +} catch { + $results["Secure Boot Enabled"] = $false +} + +# Final Verdict +$eligible = $true +foreach ($check in $results.Keys) { + if ($results[$check] -ne $true) { + $eligible = $false + } +} + +# Output +Write-Host "Windows 11 Eligibility Check:" -ForegroundColor Cyan +$results.GetEnumerator() | Sort-Object Name | Format-Table -AutoSize +Write-Host "`nResult: " -NoNewline +if ($eligible) { + Write-Host "YES – This machine is eligible for Windows 11." -ForegroundColor Green +} else { + Write-Host "NO – This machine is NOT eligible for Windows 11." -ForegroundColor Red +}