Created
June 22, 2021 16:28
-
-
Save adotcoop/e03001a77fcc974f6f14e93aa4ef7918 to your computer and use it in GitHub Desktop.
Test code to figure out latest version and download url of Android Studio for Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test code to figure out latest version and download url of Android Studio for Windows | |
# https://developer.android.com/studio | |
$xml = Invoke-WebRequest -UseBasicParsing -Uri "https://dl.google.com/android/studio/patches/updates.xml" | |
$release = "AI-2-release" | |
$node = ([xml]$xml.Content).products.product.channel | Where-Object { $_.id -eq $release } | |
$version = ($node.build.version) | |
$shortBuildNumber = ($node.build.number).Split('.')[0].Split('-')[1] | |
$longBuildNumber = ($node.build.number).Split('.')[-1] | |
$downloadUrl = "https://dl.google.com/dl/android/studio/install/$($version).0/android-studio-ide-$($shortBuildNumber).$($longBuildNumber)-windows.exe" | |
Write-Host $downloadUrl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment