Reputation: 787
So I want to find all the .xml and .pdb files and delete them from a build output folder. I can do this one at a time, but can I do this as one find matching files.
Upvotes: 5
Views: 4025
Reputation: 52798
If you are doing this as part of the TFS build process template then you need a few activities and a variable. I'll do my best to talk you through it.
matchedFiles
of type IEnumerable<String>
String.Format("{0}\**\*.xml;{0}\**\*.pdb", BuildDetail.DropLocation)
. You can change it to use BinariesDirectory
if you are not cleaning the Drop Folder.matchedFiles
String
.file
in matchedFiles
System.IO.File
Delete
In
Type: String
Value: file
Now to avoid having a every File Delete in your build log, open the Process Template XAML with Visual Studio, find the InvokeMethod
step, and add the following Attribute to the XAML:
mtbwt:BuildTrackingParticipant.Importance="None"
Upvotes: 19