I have the following powershell script that runs our unit tests:
Get-ChildItem -Path . -Recurse -Include *.Tests.csproj |
%{dotnet test $PSItem.FullName}
However, since we started using a for loop, it no longer returns a non zero value on a failed test. I still want to run everything, even if one of the tests fails. So I want to add all return codes together and return that value to indicate an error.
How can I update this powershell script to return the sum of all return values?
Edit1: This script is part of a larger CI system, so a preferred solution should only add what was requested and nothing more.