Austin Agile DevOps

DevOps in the Cloud
posts - 70 , 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. 


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""")

Print | posted on Tuesday, March 5, 2013 7:59 AM |


No comments posted yet.
Post A Comment

Powered by: