PowerToys/.pipelines/verifyNugetPackages.ps1
Jaime Bernardo d51ca9f8d4
[ci]Fix running xaml styles in CI (#35426)
XAML style checkers aren't running right now in PR CI. This allowed some XAML style errors to cause build errors in release CI.

This PR contains the following fixes:
- Fix XAML style of files that have slipped.
- Add errors to the scripts that depend on dotnet commands if it fails.
- Add .NET 6 on CI so that applyXamlStyling.ps1 and verifyNugetPackages.ps1 run correctly again.
2024-10-14 08:59:10 -05:00

25 lines
542 B
PowerShell

[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$solution
)
Write-Host "Verifying Nuget packages for $solution"
dotnet tool restore
dotnet consolidate -s $solution
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
}
if (-not $?)
{
Write-Host -ForegroundColor Red "Nuget packages with the same name must all be the same version."
exit 1
}
exit 0