Allow rebooting without registering setup
This commit is contained in:
parent
2220ca3138
commit
e1b6038f4c
2 changed files with 12 additions and 8 deletions
|
@ -596,7 +596,7 @@ $null = New-Module {
|
|||
if ($msAccount) {
|
||||
if (-not (Test-Admin)) {
|
||||
Invoke-OneShot DisableUAC;
|
||||
Restart-Computer;
|
||||
Restart-Intermediate -NoRegister;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -166,12 +166,15 @@ $null = New-Module {
|
|||
#>
|
||||
function Restart-Intermediate {
|
||||
param(
|
||||
[Parameter(ParameterSetName="Default")]
|
||||
[Parameter(ParameterSetName="None")]
|
||||
[switch] $NoRegister,
|
||||
[Parameter(ParameterSetName="Default", Mandatory)]
|
||||
[switch] $DefaultUser,
|
||||
[Parameter(ParameterSetName="Current", Mandatory)]
|
||||
[switch] $CurrentUser
|
||||
)
|
||||
|
||||
if (-not $NoRegister.IsPresent) {
|
||||
if ($DefaultUser.IsPresent) {
|
||||
Register-Setup -DefaultUser;
|
||||
} elseif ($CurrentUser.IsPresent) {
|
||||
|
@ -179,6 +182,7 @@ $null = New-Module {
|
|||
} else {
|
||||
Register-Setup;
|
||||
}
|
||||
}
|
||||
|
||||
Restart-Computer -Force;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue