From 87d7aa36c0360b8978fd8509ff05c1475b7c01df Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 25 Jun 2023 16:28:12 +0200 Subject: [PATCH] Fix resolving of the `RunOnce` key --- scripts/Windows/Scripts/Context.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/Windows/Scripts/Context.ps1 b/scripts/Windows/Scripts/Context.ps1 index 6efd5f10..eb3cae1c 100644 --- a/scripts/Windows/Scripts/Context.ps1 +++ b/scripts/Windows/Scripts/Context.ps1 @@ -80,7 +80,10 @@ class Context { $userKey = Get-Item "HKCU:\"; } - return Get-Item "$userKey\Software\Microsoft\Windows\CurrentVersion\RunOnce"; + Push-Location $userKey; + $result = Get-Item "$userKey\Software\Microsoft\Windows\CurrentVersion\RunOnce"; + Pop-Location; + return $result; } [void] RegisterReboot() {