Simplify script registration
This commit is contained in:
parent
8a59b54295
commit
76da967793
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue