Have the script show error on dotnet tool failure

This commit is contained in:
Jaime Bernardo
2024-10-14 09:58:40 +01:00
parent aa08ef74a9
commit 4f90c72fca
2 changed files with 13 additions and 0 deletions

View File

@@ -40,6 +40,12 @@ Write-Output "Use 'Help .\applyXamlStyling.ps1' for more info or '-Main' to run
Write-Output ""
Write-Output "Restoring dotnet tools..."
dotnet tool restore --disable-parallel --no-cache
if ($lastExitCode -ne 0)
{
$result = $lastExitCode
Write-Error 'Error running dotnet tool. Please verify the environment the script is running on.'
exit $result
}
if (-not $Passive)
{

View File

@@ -7,6 +7,13 @@ Param(
Write-Host "Verifying Nuget packages for $solution"
dotnet tool restore
if ($lastExitCode -ne 0)
{
$result = $lastExitCode
Write-Error 'Error running dotnet tool. Please verify the environment the script is running on.'
exit $result
}
dotnet consolidate -s $solution
if (-not $?)