From 6fd5a4a41fd9ce2f842f43dc3a69bda264c29fa6 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Fri, 12 Apr 2024 10:48:53 -0700 Subject: [PATCH] Updated UpdateLatestCU to use MU Catalog --- FFUDevelopment/BuildFFUVM.ps1 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/FFUDevelopment/BuildFFUVM.ps1 b/FFUDevelopment/BuildFFUVM.ps1 index ea1d339..2f7f70f 100644 --- a/FFUDevelopment/BuildFFUVM.ps1 +++ b/FFUDevelopment/BuildFFUVM.ps1 @@ -2052,25 +2052,26 @@ try { Add-BootFiles -OsPartitionDriveLetter $osPartitionDriveLetter -SystemPartitionDriveLetter $systemPartitionDriveLetter[1] #Update latest Cumulative Update - If ($UpdateLatestCU) { - WriteLog "`$UpdateLatestCU is set to true, checking for latest CU" - $LatestKB = Get-LatestWindowsKB -WindowsRelease $WindowsRelease - WriteLog "Latest KB for Windows $WindowsRelease found: $LatestKB" - $Name = $LatestKB + " " + $WindowsVersion + #Changed to use MU Catalog instead of using Get-LatestWindowsKB + #The Windows release info page is updated later than the MU Catalog + if ($UpdateLatestCU) { + Writelog "`$UpdateLatestCU is set to true, checking for latest CU" + $Name = "Cumulative update for Windows $WindowsRelease Version $WindowsVersion for $WindowsArch" #Check if $KBPath exists, if not, create it If (-not (Test-Path -Path $KBPath)) { WriteLog "Creating $KBPath" New-Item -Path $KBPath -ItemType Directory -Force | Out-Null } - WriteLog "Searching for $Name from Microsoft Update Catalog and saving to $KBPath" + WriteLog "Searching for $name from Microsoft Update Catalog and saving to $KBPath" $KBFilePath = Save-KB -Name $Name -Path $KBPath - WriteLog "$LatestKB saved to $KBPath\$KBFilePath" + WriteLog "Latest CU saved to $KBPath\$KBFilePath" } + #Update Latest .NET Framework if ($UpdateLatestNet) { Writelog "`$UpdateLatestNet is set to true, checking for latest .NET Framework" - $Name = "Cumulative update for .net framework windows $WindowsRelease $WindowsVersion $Architecture" + $Name = "Cumulative update for .net framework windows $WindowsRelease $WindowsVersion $WindowsArch" #Check if $KBPath exists, if not, create it If (-not (Test-Path -Path $KBPath)) { WriteLog "Creating $KBPath"