mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Windows] Rename the Invoke-SBWithRetry function (#8880)
This commit is contained in:
committed by
GitHub
parent
d2cbbb901b
commit
c73276d3f6
@@ -38,14 +38,18 @@ $tools = Get-ToolsetContent | Select-Object -ExpandProperty toolcache | Where-Ob
|
||||
|
||||
foreach ($tool in $tools) {
|
||||
# Get versions manifest for current tool
|
||||
$assets = Invoke-SBWithRetry -Command { Invoke-RestMethod $tool.url }
|
||||
# Invoke-RestMethod doesn't support retry in PowerShell 5.1
|
||||
$assets = Invoke-ScriptBlockWithRetry -Command {
|
||||
Invoke-RestMethod $tool.url
|
||||
}
|
||||
|
||||
# Get github release asset for each version
|
||||
foreach ($toolVersion in $tool.versions) {
|
||||
$asset = $assets | Where-Object version -like $toolVersion `
|
||||
| Select-Object -ExpandProperty files `
|
||||
| Where-Object { ($_.platform -eq $tool.platform) -and ($_.arch -eq $tool.arch) -and ($_.toolset -eq $tool.toolset) } `
|
||||
| Select-Object -First 1
|
||||
$asset = $assets `
|
||||
| Where-Object version -like $toolVersion `
|
||||
| Select-Object -ExpandProperty files `
|
||||
| Where-Object { ($_.platform -eq $tool.platform) -and ($_.arch -eq $tool.arch) -and ($_.toolset -eq $tool.toolset) } `
|
||||
| Select-Object -First 1
|
||||
|
||||
Write-Host "Installing $($tool.name) $toolVersion $($tool.arch)..."
|
||||
if ($null -ne $asset) {
|
||||
|
||||
Reference in New Issue
Block a user