Sometimes there are issues that never get old, this is one case.
If you're still facing this issue, this is a dirty workaround that I did, I'd be happy to take any advice on how to improve it. The script will download the latest version of the Azure Self-Hosted Integration Runtime.
function Download-Gateway ([string] $gwDownloadPath) {
# make sure the local destination path exists for download
if ($false -eq (Test-Path -Path $gwDownloadPath)) {
New-Item -Path $gwDownloadPath -ItemType 'Directory'
}
# parse Microsoft website to get integration runtime download rule
$downloadUrl = 'https://www.microsoft.com/en-ie/download/confirmation.aspx?id=39717'
$content = Invoke-WebRequest -Uri $downloadUrl
$text = ($content.Links.outerHTML | Where-Object { $_ -match 'href="https://download.microsoft.com*' }) | Select-Object -First 1
$url = ((Select-String '(http[s]?)(:\/\/)([^\s,]+)(?=")' -Input $text).Matches.Value)
$outputFullName = "$($gwDownloadPath)\$($url | Split-Path -Leaf)"
# download the latest version of the Microsoft integration runtime
$webclient = New-Object System.Net.WebClient
$webclient.DownloadFile($url,$outputFullName)
# return file full name
Write-Host "File downloaded: $($outputFullName)"
return $outputFullName
}