I am writing a script to build and test projects in a repository. For now I'm using the PowerShell command Get-ChildItem -Path test -Filter *.csproj -Recurse | ForEach-Object { dotnet test $_.FullName -c $Configuration }
to get all .csproj files in my test folder and run the tests in them. However, I notice when I run, for example, dotnet test test/ProjectA/ProjectA.csproj
I get this message:
A total of 1 test files matched the specified pattern.
Seeing this, I assumed it was possible to use a pattern to run tests in multiple projects with one command, but I can't find documentation for it or get it to work. When I try dotnet test test/**/*.csproj
I get:
MSBUILD : error MSB1009: Project file does not exist.