Skip to content

Instantly share code, notes, and snippets.

@lukejjh
Created August 22, 2021 00:08
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukejjh/c22c712c31cffb9a80ca2b9989345a1b to your computer and use it in GitHub Desktop.
Save lukejjh/c22c712c31cffb9a80ca2b9989345a1b to your computer and use it in GitHub Desktop.
PowerShell script that toggles dark mode in Windows 10/11, for both apps and system.
$k = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
$v = (Get-ItemProperty -Path $k).SystemUsesLightTheme -bxor 1
Set-ItemProperty -Path $k -Name "SystemUsesLightTheme" -Value $v
Set-ItemProperty -Path $k -Name "AppsUseLightTheme" -Value $v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment