From 7948201e1826ed4bb6e17a0f0d89194c00de6007 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Sat, 29 Nov 2025 18:44:34 -0800 Subject: [PATCH] Replace web request with BITS transfer for ESD downloads Switches from using Invoke-WebRequest to Start-BitsTransferWithRetry for downloading Windows ESD files. This provides better reliability and automatic retry handling for large file downloads. Also removes trailing blank lines for cleaner formatting. --- FFUDevelopment/BuildFFUVM.ps1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/FFUDevelopment/BuildFFUVM.ps1 b/FFUDevelopment/BuildFFUVM.ps1 index a878ff7..e0a253d 100644 --- a/FFUDevelopment/BuildFFUVM.ps1 +++ b/FFUDevelopment/BuildFFUVM.ps1 @@ -2023,7 +2023,7 @@ function Get-WindowsESD { $OriginalVerbosePreference = $VerbosePreference $VerbosePreference = 'SilentlyContinue' Mark-DownloadInProgress -FFUDevelopmentPath $FFUDevelopmentPath -TargetPath $esdFilePath - Invoke-WebRequest -Uri $file.FilePath -OutFile $esdFilePath -Headers $Headers -UserAgent $UserAgent + Start-BitsTransferWithRetry -Source $file.FilePath -Destination $esdFilePath Clear-DownloadInProgress -FFUDevelopmentPath $FFUDevelopmentPath -TargetPath $esdFilePath $VerbosePreference = $OriginalVerbosePreference WriteLog "Download succeeded" @@ -2037,8 +2037,6 @@ function Get-WindowsESD { } } - - function Get-ODTURL { try { [String]$ODTPage = Invoke-WebRequest 'https://www.microsoft.com/en-us/download/details.aspx?id=49117' -Headers $Headers -UserAgent $UserAgent -ErrorAction Stop