Splitting Out The List of TFS Checked Out Files

Needed a quick fix this week to build on Finding Checked Out Files in TFS. That one line TF.exe call gets the list of all the checked out files. For this task I just needed to find files checked out to a handful of people and generated a file for each, mostly just to do something new. Eventually I’ll dig around in the TFS db so I can just write a query for it, but this was quick and useful.


$DBAList = “warren”, “jones”, “grasshopper”, “holmes”

foreach ($DBA in $DBAList)
    get-content “c:andycheckedoutfiles.txt” | where { $_.ToString().ToLower().Contains(“$DBA”) } | out-file “C:andycheckedout_$DBA.txt”