Debian Codegraph @

external/linker/eng/common/post-build/nuget-validation.ps1

raw
1 # This script validates NuGet package metadata information using this
2 # tool: https://github.com/NuGet/NuGetGallery/tree/jver-verify/src/VerifyMicrosoftPackage
3
4 param(
5 [Parameter(Mandatory=$true)][string] $PackagesPath, # Path to where the packages to be validated are
6 [Parameter(Mandatory=$true)][string] $ToolDestinationPath # Where the validation tool should be downloaded to
7 )
8
9 try {
10 . $PSScriptRoot\post-build-utils.ps1
11
12 $url = 'https://raw.githubusercontent.com/NuGet/NuGetGallery/jver-verify/src/VerifyMicrosoftPackage/verify.ps1'
13
14 New-Item -ItemType 'directory' -Path ${ToolDestinationPath} -Force
15
16 Invoke-WebRequest $url -OutFile ${ToolDestinationPath}\verify.ps1
17
18 & ${ToolDestinationPath}\verify.ps1 ${PackagesPath}\*.nupkg
19 }
20 catch {
21 Write-Host $_.ScriptStackTrace
22 Write-PipelineTelemetryError -Category 'NuGetValidation' -Message $_
23 ExitWithExitCode 1
24 }