Multiple Excludes don't work in Powershell
See original GitHub issueI am trying to exclude multiple things but always getting an error when executing it in powershell:
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput="..\lcov.info" /p:Exclude="[*]*Examples?,[*]*Startup"
Also tried this but no luck either:
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput="..\lcov.info" /p:Exclude=\"[*]*Examples?,[*]*Startup\"
Am I doing something wrong or is this a bug?
The response is in both cases. If used alone both of them work just fine.
MSBUILD : error MSB1006: Property is not valid.
Switch: [*]*Startup
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:14
Top Results From Across the Web
How to exclude list of items from Get-ChildItem result in ...
Excluding a directory like "foo3" (not the full path) is challenging. It doesn't seem to work with -recurse or -filter.
Read more >Multiple Excludes don't work in Powershell · Issue #182
I am trying to exclude multiple things but always getting an error when executing it in powershell: dotnet test /p:CollectCoverage=true ...
Read more >[SOLVED] Excluding multiple files from a directory through ...
I can't seem to exclude all four files that are in the users' Documents directory, only one. How can this be edited or...
Read more >Powershell Get-ChildItem Include\Exclude - simple script ...
The -Exclude parameter has never really worked properly. It seems to match on the Name property, which is typically not very useful.
Read more >PowerShell Get-ChildItem -Exclude Parameter
Here is how to add more items to exclude using the simple comma. # PowerShell example to exclude multiple items. Clear-Host $FileSource =...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey guys, I’ve fiddled with this a bit and from https://github.com/Microsoft/msbuild/issues/471#issuecomment-366268743 the definitive way to fix this issue is to use
%2c
as the separator which msbuild will translate to,
This should do the trick for all Powershell related property parsing errors. Looking for a contributor to help add this to the README
I stumbled upon the same issue when executing in an docker environment (microsoft/dotnet:latest) with .NET core. %2C works as a workaround.