Blog Stats
  • Posts - 65
  • Articles - 0
  • Comments - 7
  • Trackbacks - 0

 

Using the DIR command in the TFS 2010/12 Team Build Invoke Process Activity

I found that using a loop activity to build up a filtered list clutters up the build report with repetitions of activities inside the loop. I could write a custom activity to create the list. However, rather than have to write and maintain code, it’s possible to use the DOS DIR command in the Invoke Process activity.

First, because there is no dir.exe file, you must execute a windows shell. I used “cmd” as the FileName value. 

image

Then in the Arguments value I use the shell /c switch followed by the DIR  command. It’s also possible to exclude file types from the list.

String.Format("{0} ""{1}"" {2}",  "/c dir",  BinariesDirectory,  "/b  |findstr /vi "".zip""")


Feedback

No comments posted yet.


Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 

 

 

Copyright © Bob Hardister