I have an ItemGroup that contains some files (And I have no control over how this list is created):
<ItemGroup> <AllFiles Include="Assembly1.dll;Assembly1.Tests.dll"/> <AllFiles Include="Assembly2.dll;Assembly2.Tests.dll"/> ... </ItemGroup>
And I would like to create a second ItemGroup (based on the first) containing only the file names matching ****.Tests.dll . This FilteredFiles should be: Assembly1.Tests.dll , Assembly2.Tests.dll , ...
So far I have tried:
<ItemGroup> <FilteredFiles Include="@(AllFiles)" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch(%(Filename), '\.Tests\.dll'))"/> </ItemGroup>
But that does not work.
PS: I would also like if it werenβt for his coincidences, but this is another problem.
source share