Skip to content

Commit 6e90293

Browse files
Download Set of NuGets for Smoke Test
Note: Still needs extra work to build/analyze smoke tests after as Version pinned by Nerdbank for CI.
1 parent 2b61a81 commit 6e90293

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#####
2+
# This script downloads the specified version of NuGet packages for
3+
# the required smoke tests from NuGet.
4+
# This is useful for performing current analysis on prior builds of the Toolkit.
5+
#
6+
# Pass it a Version Number of the Package you'd like to download, otherwise it'll download the LKG.
7+
# Defaults download to ../bin/nupkg/ directory
8+
####
9+
10+
param (
11+
[string] $Version = '',
12+
[string] $DownloadPath = '../bin/nupkg/'
13+
)
14+
15+
$global:ProgressPreference="SilentlyContinue"
16+
17+
Write-Host "Downloading Project NuGets for Version: $Version"
18+
19+
$ProjectFilePath = $PSScriptRoot + "\SmokeTests.proj"
20+
$NuGetDownloadUrl = "https://www.nuget.org/api/v2/package/{0}/{1}" # PackageName, Version
21+
22+
[xml]$ProjXml = Get-Content -Path $ProjectFilePath
23+
24+
$PackageList = $ProjXml.Project.PropertyGroup.ToolkitPackages -split ';'
25+
26+
Push-Location $DownloadPath
27+
28+
# Download each package
29+
foreach ($Package in $PackageList)
30+
{
31+
$PackageName = $Package.Trim() # Remove extra whitespace depending on proj file format
32+
33+
$PackageUrl = ($NuGetDownloadUrl -f $PackageName, $Version)
34+
35+
Write-Host "Downloading $PackageUrl"
36+
37+
Invoke-WebRequest $PackageUrl -OutFile ("{0}.{1}.nupkg" -f $PackageName, $Version)
38+
}
39+
40+
Pop-Location
41+
42+
Write-Host "Done"

0 commit comments

Comments
 (0)