Skip to content

Commit

Permalink
better updates
Browse files Browse the repository at this point in the history
  • Loading branch information
timmy-wright committed Jan 15, 2025
1 parent 3586f2b commit 86d8566
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion vhdbuilder/packer/configure-windows-vhd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,23 @@ function Install-ContainerD {
}

function Reapply-Long-Term-Update {
Write-Log "Reapplying Long Term Updates"
Install-Module -Name PSWindowsUpdate -Force -Scope CurrentUser
Import-Module PSWindowsUpdate
Get-WindowsUpdate | Where-Object {$_.Title -match "Cumulative Update"} | Install-WindowsUpdate -AcceptAll -AutoReboo

# Get any cumulative updates that need to be applied.
$updates = Get-WindowsUpdate

# Print the table of updates that will be applied for debugging
Write-Log "List of all updates available"
echo $updates

$updatesToApply = echo $updates | Where-Object {$_.Title -match "Cumulative Update"}
Write-Log "List of all updates to apply"
echo $updatesToApply

# Now apply them.
echo $updatesToApply | Install-WindowsUpdate -AcceptAll
}

function Install-OpenSSH {
Expand Down

0 comments on commit 86d8566

Please sign in to comment.