Azure DevOps Agent Latest Version
The best way to handle this is to get the latest release from the GitHub API and use its version tag to build the download URL for your specific platform.
The release object has an associated assets JSON file containing the download links for each package, which you can use to avoid hard-coding the URL scheme.
Here is a PowerShell example that could be easily adapted to any language:
1$release = Invoke-RestMethod https://api.github.com/repos/microsoft/azure-pipelines-agent/releases/latest
2$assets = Invoke-RestMethod $release.assets[0].browser_download_url
3$assets | Where-Object { $_.name -match "vsts-agent-win-x64*" } | Select-Object -ExpandProperty downloadUrl
Thanks to Mark Roghelia.
comments powered by Disqus