Last active
May 12, 2020 19:15
-
-
Save mattchenderson/44815f2362b447aab39a7875dd27fd35 to your computer and use it in GitHub Desktop.
PowerShell script for toggling the clock in the windows taskbar (needs to be run as administrator)
This file contains 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
param ( | |
[switch]$Revert | |
) | |
if ($Revert) { | |
# presence of the key will disable the ability to control this using the Settings app | |
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name HideClock | |
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name HideClock | |
} | |
else { | |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name HideClock -Value 1 | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name HideClock -Value 1 | |
} | |
Stop-Process -Name "explorer" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment