Skip to content

Commit 561d24b

Browse files
authored
Always reboot after installing updates (#162)
1 parent b58465e commit 561d24b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ build {
3636
}
3737
```
3838

39-
Note, the plugin automatically restarts the machine after Windows Updates are applied. The reboots occur similar to the windows-restart provisioner built into packer where packer is aware that a shutdown is in progress.
39+
Note, the plugin automatically restarts the machine after Windows Updates are applied and repeats until all updates are installed. The reboots occur similar to the windows-restart provisioner built into packer where packer is aware that a shutdown is in progress.
4040

4141
## Search Criteria, Filters and Update Limit
4242

update/windows-update.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ if ($updatesToInstall.Count) {
301301
$installRebootRequired = $false
302302
try {
303303
$installResult = $updateInstaller.Install()
304-
$installRebootRequired = $installResult.RebootRequired
304+
Write-Output "Windows update installation completed. Checking for more updates after a reboot..."
305+
$installRebootRequired = $installResult.RebootRequired -or $true
305306
} catch {
306307
Write-Warning "Windows update installation failed with error:"
307308
Write-Warning $_.Exception.ToString()

0 commit comments

Comments
 (0)