This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add this script to Task Scheduler | |
| # and schedule it to run at logon | |
| # in the action start a powershell program and give the arguments | |
| # -Command "Get-Content -Path '<Path To Script>' -Raw | Invoke-Expression" | |
| $watcher = New-Object System.IO.FileSystemWatcher; | |
| $watcher.Path = "$HOME\AppData\Local\Packages\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\TempState\ScreenClip"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $time = Get-Date | |
| $hourToSwitch = 18 | |
| $tillHour = 6 | |
| $shouldSwitchSystemTheme = 1 | |
| # function to get list of hours between hourtoswitch and tillhour | |
| function GetDarkHours() | |
| { | |
| $hours = New-Object System.Collections.Generic.List[int] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $mode = Get-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme | |
| if ($mode.AppsUseLightTheme -eq 1) { | |
| Write-Output "Mode is 1, changing to 0" | |
| Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0 | |
| } | |
| elseif ($mode.AppsUseLightTheme -eq 0) { | |
| Write-Output "Mode is 0, changing to 1" | |
| Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .Synopsis | |
| Exports environment variable from the .env file to the current process. | |
| .Description | |
| This function looks for .env file in the current directoty, if present | |
| it loads the environment variable mentioned in the file to the current process. | |
| based on https://github.com/rajivharris/Set-PsEnv |
NewerOlder