Commit 10fb9bef authored by Joe Fitzgerald's avatar Joe Fitzgerald
Browse files

Ensure SSHD does not start if we don't complete the update process

parent c18d0251
......@@ -18,6 +18,8 @@ function Check-ContinueRestartOrEnd() {
Stop-Service $script:ServiceName -Force
Set-Service -Name $script:ServiceName -StartupType Disabled -Status Stopped
} elseif ($script:Cycles -gt $global:MaxCycles) {
Write-Host "Exceeded Cycle Count - Stopping"
} else {
Write-Host "Done Installing Windows Updates"
Set-Service -Name $script:ServiceName -StartupType Automatic -Status Running
......@@ -103,7 +105,7 @@ function Install-WindowsUpdates() {
Write-Host 'Installing updates...'
$Installer = $UpdateSession.CreateUpdateInstaller()
$Installer = $script:UpdateSession.CreateUpdateInstaller()
$Installer.Updates = $UpdatesToInstall
$InstallationResult = $Installer.Install()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment