-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSet-LightTheme.ps1
36 lines (30 loc) · 1.1 KB
/
Set-LightTheme.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
}
<#
.SYNOPSIS
# Create a scheduled task to enable light theme.
.PARAMETER taskTime
What time to run the task.
.EXAMPLE
Add-EnableLightThemeTask -taskTime 7AM
#>
function Add-EnableLightThemeTask {
param (
[Parameter(Mandatory=$true)]
[string] $taskTime
)
$taskName = "Set-LightTheme"
$description = "Change Windows system and app settings to light theme."
$taskWorkingDirectory = Get-Location
$taskAction = New-ScheduledTaskAction -Execute 'powershell.exe' `
-Argument '-nologo -File Set-LightTheme.ps1' `
-WorkingDirectory $taskWorkingDirectory
$taskTrigger = New-ScheduledTaskTrigger -Daily -At $taskTime
Register-ScheduledTask -TaskName $taskName `
-Action $taskAction `
-Trigger $taskTrigger `
-Description $description
}
Set-LightTheme