Always forcefully restart computer
This commit is contained in:
parent
126c130f83
commit
3d23ce78bc
3 changed files with 3 additions and 6 deletions
|
@ -9,4 +9,4 @@ Write-Host "Starting Restoration of Windows";
|
|||
$context.EntryPoint = "$($MyInvocation.MyCommand.Path)";
|
||||
$context.UserName = "Manuel";
|
||||
Invoke-WindowsInstallation $context;
|
||||
$context.RestartComputer();
|
||||
Restart-Computer -Force;
|
||||
|
|
|
@ -46,7 +46,7 @@ function New-PersonalUser([Context] $context)
|
|||
Write-Information "Disabling Auto login";
|
||||
$context.RemoveAutologin();
|
||||
$context.SetStage("DisableUAC");
|
||||
$context.RestartComputer();
|
||||
Restart-Computer -Force;
|
||||
exit;
|
||||
}
|
||||
elseif ($context.GetStage() -eq "DisableUAC")
|
||||
|
|
|
@ -284,14 +284,11 @@ class Context {
|
|||
[void] Reboot() {
|
||||
Write-Host "Restarting Computer...";
|
||||
$this.RegisterReboot();
|
||||
$this.RestartComputer();
|
||||
Restart-Computer -Force;
|
||||
exit;
|
||||
}
|
||||
|
||||
[void] RestartComputer() {
|
||||
Restart-Computer;
|
||||
Start-Sleep 60;
|
||||
Restart-Computer -Force;
|
||||
}
|
||||
|
||||
[void] Cleanup() {
|
||||
|
|
Loading…
Reference in a new issue