File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments