Download latest stable version of datafactory integration runtime msi using powershell?

Atul Sahu 26 Reputation points
2021-06-20T05:56:00.27+00:00

I want to download the latest integration runtime software from the URL https://www.microsoft.com/en-us/download/details.aspx?id=39717,

using invoke-webrequest command without manual intervention.
I believe there is a two-step logic to fetch the correct file name and associated path.

i am interested in understanding this logic so that I can modify & generate a script for myself.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,532 questions
0 comments No comments
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA-MSFT 76,921 Reputation points Microsoft Employee
    2021-06-21T06:11:54.237+00:00

    Hello @Atul Sahu ,

    Welcome to the Microsoft Q&A platform.

    To automate installation of Self-hosted Integration Runtime on local machines, you can use local PowerShell scripts.

    This article - Automating self-hosted integration runtime installation using local PowerShell scripts introduces two scripts you can use.

    Hope this helps. Do let us know if you any further queries.

    ------------

    • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification.

2 additional answers

Sort by: Most helpful
  1. Everton Oliveira 96 Reputation points
    2023-01-09T17:23:47.15+00:00

    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
    }
    
    0 comments No comments

  2. Atul Sahu 26 Reputation points
    2023-01-10T20:46:00.437+00:00
    0 comments No comments