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