From 0f7d7a82caa1a89cac0b656cf840ada34caaa37e Mon Sep 17 00:00:00 2001 From: ilia-shipitsin <125650415+ilia-shipitsin@users.noreply.github.com> Date: Tue, 18 Jul 2023 17:47:39 +0200 Subject: [PATCH] [macos] download XCode installer with retries (#7898) --- images/macos/helpers/Xcode.Installer.psm1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/images/macos/helpers/Xcode.Installer.psm1 b/images/macos/helpers/Xcode.Installer.psm1 index af7e1ec6e..89024f6d0 100644 --- a/images/macos/helpers/Xcode.Installer.psm1 +++ b/images/macos/helpers/Xcode.Installer.psm1 @@ -11,7 +11,7 @@ function Install-XcodeVersion { $xcodeDownloadDirectory = "$env:HOME/Library/Caches/XcodeInstall" $xcodeTargetPath = Get-XcodeRootPath -Version $LinkTo $xcodeXipDirectory = Invoke-DownloadXcodeArchive -DownloadDirectory $xcodeDownloadDirectory -Version $Version - Expand-XcodeXipArchive -DownloadDirectory $xcodeXipDirectory -TargetPath $xcodeTargetPath + Expand-XcodeXipArchive -DownloadDirectory $xcodeXipDirectory.FullName -TargetPath $xcodeTargetPath Remove-Item -Path $xcodeXipDirectory -Force -Recurse } @@ -31,8 +31,7 @@ function Invoke-DownloadXcodeArchive { $xcodeFileName = 'Xcode-{0}.xip' -f $Version $xcodeUri = '{0}{1}{2}'-f ${env:XCODE_INSTALL_STORAGE_URL}, $xcodeFileName, ${env:XCODE_INSTALL_SAS} - Invoke-WebRequest -Uri $xcodeUri -OutFile (Join-Path $tempXipDirectory $xcodeFileName) - + Start-DownloadWithRetry -Url $xcodeUri -DownloadPath $tempXipDirectory.FullName -Name $xcodeFileName return $tempXipDirectory }