Add a method for removing config values
This commit is contained in:
parent
aa5d71eb4f
commit
7f71def89e
1 changed files with 10 additions and 5 deletions
|
@ -31,11 +31,6 @@ class Context {
|
||||||
return Get-Item $this.ConfigRoot;
|
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) {
|
[object] Get([string] $key) {
|
||||||
$configKey = $this.EnsureConfigKey();
|
$configKey = $this.EnsureConfigKey();
|
||||||
if ($configKey.GetValueNames().Contains($key)) {
|
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) {
|
[void] SetStage([string] $name) {
|
||||||
$this.Set($this.StagePropertyName, $name, "ExpandString");
|
$this.Set($this.StagePropertyName, $name, "ExpandString");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue