Created
October 14, 2021 04:57
-
-
Save LawrenceHwang/d7c5809dc50f1ad8cf40a008ec0c9810 to your computer and use it in GitHub Desktop.
Helper function to set the taskbar icon size
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
function Set-TaskbarIconSize { | |
# Sets the windows 11 task bar icon size. Default value is medium. | |
[CmdletBinding()] | |
param( | |
[validateset("small", "medium", "large")] | |
[string]$Size = "medium" | |
) | |
$sizeChart = @{ | |
"small" = 0 | |
"medium" = 1 | |
"large" = 2 | |
} | |
try { | |
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\' -Name 'TaskbarSi' -Value $sizeChart[$Size] | |
Write-Warning -Message "Taskbar icon set to $Size, please reboot to take effect." | |
} catch { | |
$PSItem | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment