Add script to download nugets from release definition

This commit is contained in:
Guillaume Perrot 2017-11-16 14:00:48 -08:00
Родитель 27bd1dcb92
Коммит a2671c00ab
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,11 @@
$basePackage="Microsoft.AppCenter"
$version=(Select-String -Path windows/nuspecs/nuget/AppCenter.nuspec -Pattern "version>(.*)<").Matches.Groups[1].Value
foreach ($packageSuffix in @("", ".Analytics", ".Crashes", ".Distribute", ".Push")) {
$package = "$basePackage$packageSuffix"
$url = "https://msmobilecenter.pkgs.visualstudio.com/_apis/packaging/feeds/$env:NUGET_FEED_ID/nuget/packages/$package/versions/$version/content"
$password = [System.Text.Encoding]::UTF8.GetBytes("appcenter:$env:NUGET_PASSWORD")
$password = [System.Convert]::ToBase64String($password)
$webClient = New-Object System.Net.WebClient
$webClient.Headers.Add("Authorization","Basic $password")
$webClient.DownloadFile($url, "$pwd/$package.$version.nupkg")
}