Today I discovered that you can redirect the output of Team Foundation Service’s tf.exe command to a file. I thought that because it displayed dialog boxes as the results of commands that you couldn’t redirect its output to files. However, commands such as tf history will do just that when you specify redirection, such as:
1 "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe" history * /recursive > history.txt
Of course, if your Visual Studio directory is in your PATH, then you can just specify “tf history…”. Note that you may also need to adjust your path, as earlier/later versions of Visual Studio will not be stored under the “Microsoft Visual Studio 11.0” directory.
This post was migrated from https://blogs.msdn.microsoft.com/rob/2013/08/27/redirecting-tfs-command-output-to-files/.