add ep refresh for dark mode toggle (#2732)

This commit is contained in:
MyDrift
2024-09-20 16:01:39 +02:00
committed by GitHub
parent 06baebc60b
commit 1ee7274bdb
2 changed files with 34 additions and 0 deletions

View File

@ -21,6 +21,7 @@ Function Invoke-WinUtilDarkMode {
$Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
Set-ItemProperty -Path $Path -Name AppsUseLightTheme -Value $DarkMoveValue
Set-ItemProperty -Path $Path -Name SystemUsesLightTheme -Value $DarkMoveValue
Invoke-WinUtilExplorerRefresh
} catch [System.Security.SecurityException] {
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
} catch [System.Management.Automation.ItemNotFoundException] {