mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
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.
This commit is contained in:
@@ -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 {
|
function Get-MicrosoftDrivers {
|
||||||
param (
|
param (
|
||||||
[string]$Make,
|
[string]$Make,
|
||||||
|
|||||||
Reference in New Issue
Block a user