Fix broken reboot registration

This commit is contained in:
Manuel Thalmann 2024-08-09 15:49:36 +02:00
parent f01409fcd5
commit 92e4889417

View file

@ -141,7 +141,7 @@ $null = New-Module {
[switch] $DefaultUser [switch] $DefaultUser
) )
$register = { param($Key) Register-Setup -UserKey $Key; }; $register = { param($UserKey) Register-Setup @PSBoundParameters; };
if ($DefaultUser) { if ($DefaultUser) {
Edit-DefaultUserKey { Edit-DefaultUserKey {
@ -149,11 +149,12 @@ $null = New-Module {
[RegistryKey] $Key [RegistryKey] $Key
) )
& $register -Key $Key; & $register $Key;
} }
} else {
& $register;
} }
& $register;
Read-Host "Press enter to reboot"; Read-Host "Press enter to reboot";
Restart-Computer -Force; Restart-Computer -Force;
} }