From f0504b9960c0ca23042affa1527ef7f538cf5420 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 12 Sep 2024 18:44:58 +0200 Subject: [PATCH] Allow removing setup options --- scripts/Common/Scripts/Config.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/Common/Scripts/Config.ps1 b/scripts/Common/Scripts/Config.ps1 index 7a94d744..b3b6097d 100644 --- a/scripts/Common/Scripts/Config.ps1 +++ b/scripts/Common/Scripts/Config.ps1 @@ -346,8 +346,13 @@ $null = New-Module { $Value ) - $key = Get-SetupConfigKey; - $null = Set-ItemProperty ($key.PSPath) -Name $Name -Value $Value; + $key = (Get-SetupConfigKey).PSPath; + + if ($null -eq $Value) { + Remove-ItemProperty $key -Name $Name; + } else { + $null = Set-ItemProperty $key -Name $Name -Value $Value; + } } <#