Add a method for removing config values

This commit is contained in:
Manuel Thalmann 2023-06-29 19:11:16 +02:00
parent aa5d71eb4f
commit 7f71def89e

View file

@ -31,11 +31,6 @@ class Context {
return Get-Item $this.ConfigRoot;
}
[void] Set([string] $key, $value, [Microsoft.Win32.RegistryValueKind] $type) {
$configKey = $this.EnsureConfigKey();
$configKey.SetValue($key, $value, $type);
}
[object] Get([string] $key) {
$configKey = $this.EnsureConfigKey();
if ($configKey.GetValueNames().Contains($key)) {
@ -45,6 +40,16 @@ class Context {
}
}
[void] Set([string] $key, $value, [Microsoft.Win32.RegistryValueKind] $type) {
$configKey = $this.EnsureConfigKey();
$configKey.SetValue($key, $value, $type);
}
[void] Remove([string] $key) {
$configKey = $this.EnsureConfigKey();
$configKey.DeleteValue($key);
}
[void] SetStage([string] $name) {
$this.Set($this.StagePropertyName, $name, "ExpandString");
}