Skip to content

Commit

Permalink
grab first link
Browse files Browse the repository at this point in the history
  • Loading branch information
mShan0 committed Jun 5, 2023
1 parent 97adfd2 commit 22993ec
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,13 @@ jobs:
}
if (${{ matrix.mssql-version }} -ne '2016') {
$response = Invoke-WebRequest -Uri $update_link
echo $response
$dl_link = ($response.Links.href | Where-Object {$_ -like 'https://download.microsoft.com/*'})
echo $dl_link
$update_download_link = [System.Uri]::new($dl_link)
$dl_links = ((Invoke-WebRequest -Uri $update_link).Links | Where-Object {$_.href -like 'https://download.microsoft.com/*'})
if ($dl_links.count -gt 0) {
$update_download_link = [System.Uri]::new($dl_links[0].href)
} else {
Write-Error "Download link not found"
Exit 1
}
echo $update_download_link
}
Expand Down

0 comments on commit 22993ec

Please sign in to comment.