Simplify script registration
This commit is contained in:
parent
8a59b54295
commit
76da967793
|
@ -159,20 +159,18 @@ $null = New-Module {
|
||||||
[switch] $CurrentUser
|
[switch] $CurrentUser
|
||||||
)
|
)
|
||||||
|
|
||||||
$register = { param($UserKey) Register-Setup @PSBoundParameters; };
|
|
||||||
|
|
||||||
if ($DefaultUser.ToBool()) {
|
if ($DefaultUser.ToBool()) {
|
||||||
Edit-DefaultUserKey {
|
Edit-DefaultUserKey {
|
||||||
param(
|
param(
|
||||||
[RegistryKey] $Key
|
[RegistryKey] $Key
|
||||||
)
|
)
|
||||||
|
|
||||||
& $register $Key;
|
Register-Setup -UserKey $Key;
|
||||||
}
|
}
|
||||||
} elseif ($CurrentUser.ToBool()) {
|
} elseif ($CurrentUser.ToBool()) {
|
||||||
& $register (Get-Item HKCU:\);
|
Register-Setup -User;
|
||||||
} else {
|
} else {
|
||||||
& $register;
|
Register-Setup;
|
||||||
}
|
}
|
||||||
|
|
||||||
Restart-Computer -Force;
|
Restart-Computer -Force;
|
||||||
|
|
Loading…
Reference in a new issue