question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple Excludes don't work in Powershell

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:14

github_iconTop GitHub Comments

17reactions
tonerdocommented, Sep 1, 2018

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 ,

/p:Exclude="[*]*Examples?%2c[*]*Startup"

This should do the trick for all Powershell related property parsing errors. Looking for a contributor to help add this to the README

5reactions
breigocommented, May 9, 2019

I stumbled upon the same issue when executing in an docker environment (microsoft/dotnet:latest) with .NET core. %2C works as a workaround.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found