Refactor registry value handling
This commit is contained in:
parent
416facf2a0
commit
0b2e2744b0
1 changed files with 2 additions and 2 deletions
|
@ -91,7 +91,7 @@ class Context {
|
||||||
}
|
}
|
||||||
|
|
||||||
[void] RegisterReboot([Microsoft.Win32.RegistryKey] $userKey) {
|
[void] RegisterReboot([Microsoft.Win32.RegistryKey] $userKey) {
|
||||||
$null = New-ItemProperty -Path $this.GetRunOnceKey($userKey) -Name $this.RunOnceName -Value "pwsh `"$($this.EntryPoint)`"" -PropertyType ExpandString;
|
$null = $this.GetRunOnceKey($userKey).SetValue($this.RunOnceName, "pwsh `"$($this.EntryPoint)`"", "ExpandString");
|
||||||
}
|
}
|
||||||
|
|
||||||
[void] RegisterNewUserReboot() {
|
[void] RegisterNewUserReboot() {
|
||||||
|
@ -99,7 +99,7 @@ class Context {
|
||||||
}
|
}
|
||||||
|
|
||||||
[void] DeregisterNewUserReboot() {
|
[void] DeregisterNewUserReboot() {
|
||||||
$this.ProcessDefaultUserKey({ param ($root) Remove-ItemProperty $this.GetRunOnceKey($root) -Name $this.RunOnceName });
|
$this.ProcessDefaultUserKey({ param ($root) $this.GetRunOnceKey($root).DeleteValue($this.RunOnceName) });
|
||||||
}
|
}
|
||||||
|
|
||||||
[void] Reboot() {
|
[void] Reboot() {
|
||||||
|
|
Loading…
Reference in a new issue