From 92e4889417d059052f5fd6086bc54eb2afba7b77 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 9 Aug 2024 15:49:36 +0200 Subject: [PATCH] Fix broken reboot registration --- scripts/Windows/Scripts/PowerManagement.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/Windows/Scripts/PowerManagement.ps1 b/scripts/Windows/Scripts/PowerManagement.ps1 index 07da69a9..6c361b34 100644 --- a/scripts/Windows/Scripts/PowerManagement.ps1 +++ b/scripts/Windows/Scripts/PowerManagement.ps1 @@ -141,7 +141,7 @@ $null = New-Module { [switch] $DefaultUser ) - $register = { param($Key) Register-Setup -UserKey $Key; }; + $register = { param($UserKey) Register-Setup @PSBoundParameters; }; if ($DefaultUser) { Edit-DefaultUserKey { @@ -149,11 +149,12 @@ $null = New-Module { [RegistryKey] $Key ) - & $register -Key $Key; + & $register $Key; } + } else { + & $register; } - & $register; Read-Host "Press enter to reboot"; Restart-Computer -Force; }