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

Atul Sahu 26 Reputation points

I want to download the latest integration runtime software from the URL,

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,528 questions
0 comments No comments
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA-MSFT 76,921 Reputation points Microsoft Employee

    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

    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 = ''
        $content = Invoke-WebRequest -Uri $downloadUrl
        $text = ($content.Links.outerHTML | Where-Object { $_ -match 'href="*' }) | 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
        # return file full name
        Write-Host "File downloaded: $($outputFullName)"
        return $outputFullName
    0 comments No comments

  2. Atul Sahu 26 Reputation points
    0 comments No comments