2022-11-24 20:45:51 +01:00
|
|
|
[CmdletBinding()]
|
|
|
|
Param(
|
|
|
|
[Parameter(Mandatory=$True,Position=1)]
|
|
|
|
[string]$solution
|
|
|
|
)
|
|
|
|
|
|
|
|
Write-Host "Verifying Nuget packages for $solution"
|
|
|
|
|
|
|
|
dotnet tool restore
|
|
|
|
dotnet consolidate -s $solution
|
2024-10-14 14:59:10 +01:00
|
|
|
if ($lastExitCode -ne 0)
|
|
|
|
{
|
|
|
|
$result = $lastExitCode
|
|
|
|
Write-Error "Error running dotnet consolidate, with the exit code $lastExitCode. Please verify logs and running environment."
|
|
|
|
exit $result
|
|
|
|
}
|
2022-11-24 20:45:51 +01:00
|
|
|
|
|
|
|
if (-not $?)
|
|
|
|
{
|
|
|
|
Write-Host -ForegroundColor Red "Nuget packages with the same name must all be the same version."
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2025-08-21 03:07:14 -07:00
|
|
|
# Ignore NU1503 on vcxproj files
|
|
|
|
dotnet restore $solution /nowarn:NU1503
|
|
|
|
if ($lastExitCode -ne 0)
|
|
|
|
{
|
|
|
|
$result = $lastExitCode
|
|
|
|
Write-Error "Error running dotnet restore, with the exit code $lastExitCode. Please verify logs on the nuget package versions."
|
|
|
|
exit $result
|
|
|
|
}
|
|
|
|
|
2022-11-24 20:45:51 +01:00
|
|
|
exit 0
|