PowerShell: Toggle Dark Theme
Using PowerShell to set dark theme.
put this in your PowerShell Profile
function xah-toggle-darktheme { <# .DESCRIPTION Toggle dark theme Version 2022-01-15 2022-06-08 .LINK http://xahlee.info/powershell/powershell_set_darktheme.html #> $xpath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"; $xname = "AppsUseLightTheme"; if ((Get-ItemProperty $xpath -Name AppsUseLightTheme).$xname -eq 1) { Set-ItemProperty $xpath -Name $xname -Value 0; } else { Set-ItemProperty $xpath -Name $xname -Value 1; } }