From 0fd482d9960f0e8e6ecd632e1121f66c84170b5c Mon Sep 17 00:00:00 2001 From: apaladi Date: Tue, 27 Jun 2023 18:04:29 +0200 Subject: [PATCH] fix Save-WebFile.ps1 https://github.com/OSDeploy/OSD/pull/46/commits/6bd1a19a28815700f1bc0f236e8af3b14df720ad --- Public/Functions/Other/Save-WebFile.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Public/Functions/Other/Save-WebFile.ps1 b/Public/Functions/Other/Save-WebFile.ps1 index a8764a0f..1fd1d8c8 100644 --- a/Public/Functions/Other/Save-WebFile.ps1 +++ b/Public/Functions/Other/Save-WebFile.ps1 @@ -109,9 +109,9 @@ function Save-WebFile { if ($UseWebClient -eq $true) { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls1 - $WebClient = New-Object System.Net.WebClient - $WebClient.DownloadFile($SourceUrl, $DestinationFullName) - $WebClient.Dispose() + $WebClientTemp = New-Object System.Net.WebClient + $WebClientTemp.DownloadFile($SourceUrl, $DestinationFullName) + $WebClientTemp.Dispose() } else { Write-Verbose "cURL Source: $SourceUrl" @@ -137,4 +137,4 @@ function Save-WebFile { } #================================================= } -} \ No newline at end of file +}