diff --git a/build.psm1 b/build.psm1 index fa2144e16e..495b44b47f 100644 --- a/build.psm1 +++ b/build.psm1 @@ -694,25 +694,28 @@ function Restore-PSPackage } $ProjectDirs | ForEach-Object { - Write-Log "Run dotnet restore $_ $RestoreArguments" + $project = $_ + Write-Log "Run dotnet restore $project $RestoreArguments" $retryCount = 0 $maxTries = 5 while($retryCount -lt $maxTries) { try { - Start-NativeExecution { dotnet restore $_ $RestoreArguments } + Start-NativeExecution { dotnet restore $project $RestoreArguments } } catch { - Write-Log "Failed to restore $_, retrying..." + Write-Log "Failed to restore $project, retrying..." $retryCount++ if($retryCount -ge $maxTries) { throw } + continue } + Write-Log "Done restoring $project" break } }