2019-06-28 13:15:43 +00:00
|
|
|
# This script validates NuGet package metadata information using this
|
|
|
|
# tool: https://github.com/NuGet/NuGetGallery/tree/jver-verify/src/VerifyMicrosoftPackage
|
|
|
|
|
|
|
|
param(
|
|
|
|
[Parameter(Mandatory=$true)][string] $PackagesPath, # Path to where the packages to be validated are
|
|
|
|
[Parameter(Mandatory=$true)][string] $ToolDestinationPath # Where the validation tool should be downloaded to
|
|
|
|
)
|
|
|
|
|
|
|
|
try {
|
2019-11-22 13:41:58 +00:00
|
|
|
. $PSScriptRoot\post-build-utils.ps1
|
|
|
|
|
2020-02-16 13:44:22 +00:00
|
|
|
$url = 'https://raw.githubusercontent.com/NuGet/NuGetGallery/3e25ad135146676bcab0050a516939d9958bfa5d/src/VerifyMicrosoftPackage/verify.ps1'
|
2019-06-28 13:15:43 +00:00
|
|
|
|
2019-11-22 13:41:58 +00:00
|
|
|
New-Item -ItemType 'directory' -Path ${ToolDestinationPath} -Force
|
2019-06-28 13:15:43 +00:00
|
|
|
|
|
|
|
Invoke-WebRequest $url -OutFile ${ToolDestinationPath}\verify.ps1
|
|
|
|
|
|
|
|
& ${ToolDestinationPath}\verify.ps1 ${PackagesPath}\*.nupkg
|
|
|
|
}
|
|
|
|
catch {
|
|
|
|
Write-Host $_.ScriptStackTrace
|
2019-11-22 13:41:58 +00:00
|
|
|
Write-PipelineTelemetryError -Category 'NuGetValidation' -Message $_
|
2019-06-28 13:15:43 +00:00
|
|
|
ExitWithExitCode 1
|
|
|
|
}
|