Back up original spacing property

This commit is contained in:
Manuel Thalmann 2023-07-17 16:12:26 +02:00
parent 58622be1b1
commit 32a8ec94b1

View file

@ -6,7 +6,9 @@ $action = {
param([Microsoft.Win32.RegistryKey] $userKey)
$spacingProperty = "IconSpacing";
$keyPath = "$($userKey.PSPath)\Control Panel\Desktop\WindowMetrics";
$relativeKeyPath = "Control Panel\Desktop\WindowMetrics"
$keyPath = "$($userKey.PSPath)\$relativeKeyPath";
Copy-ItemProperty "HKCU:\$relativeKeyPath" "$keyPath" "$spacingProperty";
Rename-ItemProperty $keyPath $spacingProperty "_$spacingProperty";
Set-ItemProperty $keyPath -Name $spacingProperty -Value "-1710" -Type "String";
}