Win11Debloat/Scripts/GUI/GetSystemUsesDarkMode.ps1
soccerzockt db24865051
Add Support for "-user" Parameter running under SYSTEM (#609)
Co-authored-by: Jeffrey <9938813+Raphire@users.noreply.github.com>
2026-06-07 22:51:01 +02:00

17 lines
502 B
PowerShell

# Checks if the system is set to use dark mode for apps
function GetSystemUsesDarkMode {
try {
$personalizeKey = Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize'
if ($null -eq $personalizeKey) {
Write-Host "WARNING: Unable to retrieve personalization settings." -ForegroundColor Yellow
return $false
}
return $personalizeKey.AppsUseLightTheme -eq 0
}
catch {
return $false
}
}