Welcome to mirror list, hosted at ThFree Co, Russian Federation.

nuget-validation.ps1 « post-build « common « eng - github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dab3534ab53893d6bb0d05ce13317704c70eea21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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 {
  . $PSScriptRoot\post-build-utils.ps1

  $url = 'https://raw.githubusercontent.com/NuGet/NuGetGallery/3e25ad135146676bcab0050a516939d9958bfa5d/src/VerifyMicrosoftPackage/verify.ps1'

  New-Item -ItemType 'directory' -Path ${ToolDestinationPath} -Force

  Invoke-WebRequest $url -OutFile ${ToolDestinationPath}\verify.ps1 

  & ${ToolDestinationPath}\verify.ps1 ${PackagesPath}\*.nupkg
} 
catch {
  Write-Host $_.ScriptStackTrace
  Write-PipelineTelemetryError -Category 'NuGetValidation' -Message $_
  ExitWithExitCode 1
}