From 32a8ec94b184465da42605cad7a2634cfcc96313 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 17 Jul 2023 16:12:26 +0200 Subject: [PATCH] Back up original spacing property --- scripts/Windows/Config/Windows/Install.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/Windows/Config/Windows/Install.ps1 b/scripts/Windows/Config/Windows/Install.ps1 index 146440d6..44efb54c 100644 --- a/scripts/Windows/Config/Windows/Install.ps1 +++ b/scripts/Windows/Config/Windows/Install.ps1 @@ -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"; }