Initial commit

This commit is contained in:
2026-06-05 13:31:10 +02:00
commit b2d9581c25
12 changed files with 1006 additions and 0 deletions

37
scripts/theme.ps1 Normal file
View File

@@ -0,0 +1,37 @@
# Modify Windows 10/11 or Server theme (Light or Dark mode). Makes registry changes which
# take effect upon reboot, or explorer.exe restart. Bypasses restriction to change theme on
# unactivated Windows installations.
#
# Usage:
# To switch to dark mode, run: .\theme.ps1 -Mode dark
# To switch to light mode, run: .\theme.ps1 -Mode light
#
# Optional: Restart the explorer.exe process:
# "Stop-Process -Name explorer -Force; Start-Sleep -Seconds 2; Start-Process explorer"
param (
[Parameter(Mandatory=$true)]
[ValidateSet("light", "dark")]
[string]$Mode
)
function Set-DarkTheme {
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "AppsUseLightTheme" -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "SystemUsesLightTheme" -Value 0
Write-Host -f Yellow "Dark theme enabled.`n"
}
function Set-LightTheme {
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "AppsUseLightTheme" -Value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "SystemUsesLightTheme" -Value 1
Write-Host -f Yellow "Light theme enabled.`n"
}
switch ($Mode) {
"dark" {
Set-DarkTheme
}
"light" {
Set-LightTheme
}
}