Allow registering reboots for users
This commit is contained in:
parent
19e84bd4ab
commit
141b8290da
|
@ -153,12 +153,15 @@ $null = New-Module {
|
|||
#>
|
||||
function Restart-Intermediate {
|
||||
param(
|
||||
[switch] $DefaultUser
|
||||
[Parameter(ParameterSetName="Default", Mandatory)]
|
||||
[switch] $DefaultUser,
|
||||
[Parameter(ParameterSetName="Current", Mandatory)]
|
||||
[switch] $CurrentUser
|
||||
)
|
||||
|
||||
$register = { param($UserKey) Register-Setup @PSBoundParameters; };
|
||||
|
||||
if ($DefaultUser) {
|
||||
if ($DefaultUser.ToBool()) {
|
||||
Edit-DefaultUserKey {
|
||||
param(
|
||||
[RegistryKey] $Key
|
||||
|
@ -166,6 +169,8 @@ $null = New-Module {
|
|||
|
||||
& $register $Key;
|
||||
}
|
||||
} elseif ($CurrentUser.ToBool()) {
|
||||
& $register (Get-Item HKCU:\);
|
||||
} else {
|
||||
& $register;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue