From 42e65904deb3221dfec9c0d3b744f9a99b87251e Mon Sep 17 00:00:00 2001 From: kishorekumar-anchala <168699259+kishorekumar-anchala@users.noreply.github.com> Date: Tue, 17 Jun 2025 20:03:00 +0530 Subject: [PATCH] [windows] Replace WebClient with Invoke-WebRequest & Update EdgeDrive Thumbprint (#12390) * [windows] Update EdgeDriver signature * feat: Improve temp directory handling and update file download method - Added check for \ existence before accessing it. - If the directory does not exist, it is now created. - Replaced System.Net.WebClient with Invoke-WebRequest for file downloads, improving compatibility and maintainability. Co-authored-by: Subir0071 * [Windows] Remove check for TEMP_Dir --------- Co-authored-by: Subir0071 --- images/windows/scripts/build/Install-EdgeDriver.ps1 | 3 ++- images/windows/scripts/helpers/InstallHelpers.ps1 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/images/windows/scripts/build/Install-EdgeDriver.ps1 b/images/windows/scripts/build/Install-EdgeDriver.ps1 index 8644e1113..fe196f465 100644 --- a/images/windows/scripts/build/Install-EdgeDriver.ps1 +++ b/images/windows/scripts/build/Install-EdgeDriver.ps1 @@ -29,7 +29,8 @@ Expand-7ZipArchive -Path $archivePath -DestinationPath $edgeDriverPath #Validate the EdgeDriver signature $signatureThumbprint = @( "7920AC8FB05E0FFFE21E8FF4B4F03093BA6AC16E", - "0BD8C56733FDCC06F8CB919FF5A200E39B1ACF71" + "0BD8C56733FDCC06F8CB919FF5A200E39B1ACF71", + "F6EECCC7FF116889C2D5466AE7243D7AA7698689" ) Test-FileSignature -Path "$edgeDriverPath\msedgedriver.exe" -ExpectedThumbprint $signatureThumbprint diff --git a/images/windows/scripts/helpers/InstallHelpers.ps1 b/images/windows/scripts/helpers/InstallHelpers.ps1 index 219d30cdd..f984d8ea1 100644 --- a/images/windows/scripts/helpers/InstallHelpers.ps1 +++ b/images/windows/scripts/helpers/InstallHelpers.ps1 @@ -198,7 +198,7 @@ function Invoke-DownloadWithRetry { for ($retries = 20; $retries -gt 0; $retries--) { try { $attemptStartTime = Get-Date - (New-Object System.Net.WebClient).DownloadFile($Url, $Path) + Invoke-WebRequest -Uri $Url -OutFile $Path -UseBasicParsing $attemptSeconds = [math]::Round(($(Get-Date) - $attemptStartTime).TotalSeconds, 2) Write-Host "Package downloaded in $attemptSeconds seconds" break