Skip to content

Instantly share code, notes, and snippets.

@hl2guide
Created September 3, 2023 08:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hl2guide/cbb7dab4ad875d8165b76dd35fe28852 to your computer and use it in GitHub Desktop.
Save hl2guide/cbb7dab4ad875d8165b76dd35fe28852 to your computer and use it in GitHub Desktop.
PowerShell - Improve Windows after New Install (in development)
# Improves Windows 11/10 after a fresh install - Run as Admin
$boolSetDarkModeForApps = $true
$boolSetDarkModeForSystem = $true
# Sets dark or light mode
if($boolSetDarkModeForApps -eq $true)
{
# Sets dark mode for apps
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize `
-Name AppsUseLightTheme -Value 0 -Type Dword -ErrorAction SilentlyContinue
}
else
{
# Sets light mode for apps
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize `
-Name AppsUseLightTheme -Value 1 -Type Dword -ErrorAction SilentlyContinue
}
if($boolSetDarkModeForSystem)
{
# Sets dark mode for system
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize `
-Name SystemUsesLightTheme -Value 0 -Type Dword -Force -ErrorAction SilentlyContinue
}
else
{
# Sets light mode for system
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize `
-Name SystemUsesLightTheme -Value 1 -Type Dword -Force -ErrorAction SilentlyContinue
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment