From 315f0f3858d45975d4f1b3d8926199ab5cc86af2 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Mon, 14 Jul 2025 16:57:11 -0700 Subject: [PATCH] Refactor: Remove unused BITS transfer function Removes the `Start-BitsTransferWithRetry` function as it is no longer in use. This change cleans up the script by removing dead code. --- FFUDevelopment/BuildFFUVM.ps1 | 36 ----------------------------------- 1 file changed, 36 deletions(-) diff --git a/FFUDevelopment/BuildFFUVM.ps1 b/FFUDevelopment/BuildFFUVM.ps1 index eee87ae..6b5813f 100644 --- a/FFUDevelopment/BuildFFUVM.ps1 +++ b/FFUDevelopment/BuildFFUVM.ps1 @@ -704,42 +704,6 @@ function Test-Url { } } -# Function to download a file using BITS with retry and error handling -# function Start-BitsTransferWithRetry { -# param ( -# [Parameter(Mandatory = $true)] -# [string]$Source, -# [Parameter(Mandatory = $true)] -# [string]$Destination, -# [int]$Retries = 3 -# ) - -# $attempt = 0 -# $lastError = $null - -# while ($attempt -lt $Retries) { -# try { -# $OriginalVerbosePreference = $VerbosePreference -# $VerbosePreference = 'SilentlyContinue' -# # $ProgressPreference = 'SilentlyContinue' -# Start-BitsTransfer -Source $Source -Destination $Destination -ErrorAction Stop -# # $ProgressPreference = 'Continue' -# $VerbosePreference = $OriginalVerbosePreference -# return -# } -# catch { -# # Capture the error that occurred during the failed download attempt -# $lastError = $_ -# $attempt++ -# WriteLog "Attempt $attempt of $Retries failed to download $Source with error: $($lastError.Exception.Message). Retrying..." -# Start-Sleep -Seconds 5 -# } -# } - -# WriteLog "Failed to download $Source after $Retries attempts. Error: $($lastError.Exception.Message)" -# throw $lastError -# } - function Get-MicrosoftDrivers { param ( [string]$Make,