Simplify script registration

This commit is contained in:
Manuel Thalmann 2024-08-19 02:24:13 +02:00
parent 611c3e872e
commit 42ca57c698

View file

@ -159,20 +159,18 @@ $null = New-Module {
[switch] $CurrentUser
)
$register = { param($UserKey) Register-Setup @PSBoundParameters; };
if ($DefaultUser.ToBool()) {
Edit-DefaultUserKey {
param(
[RegistryKey] $Key
)
& $register $Key;
Register-Setup -UserKey $Key;
}
} elseif ($CurrentUser.ToBool()) {
& $register (Get-Item HKCU:\);
Register-Setup -User;
} else {
& $register;
Register-Setup;
}
Restart-Computer -Force;