Pause before reboot when debugging

This commit is contained in:
Manuel Thalmann 2024-09-12 19:04:37 +02:00
parent ff284c1493
commit e1d3191020
2 changed files with 5 additions and 0 deletions

View file

@ -77,6 +77,7 @@ $null = New-Module {
} }
$Global:InOperation = $true; $Global:InOperation = $true;
$Global:NonInteractive = $NonInteractive;
$Global:ErrorActionPreference = $NonInteractive.IsPresent ? 'Continue' : 'Inquire'; $Global:ErrorActionPreference = $NonInteractive.IsPresent ? 'Continue' : 'Inquire';
if ($IsWindows) { if ($IsWindows) {

View file

@ -185,6 +185,10 @@ $null = New-Module {
} }
} }
if ($env:DEBUG -and (-not $Global:NonInteractive)) {
Read-Host "Press enter to reboot";
}
Restart-Computer -Force; Restart-Computer -Force;
} }
} }