Team Foundation Server 2010 Command-Line Utility

On a system I use, I needed to rollback a changeset recently checked-in in Team Foundation Server 2010 but ran into a problem. The problem was that if I went to the directory where the command-line tool TF.exe was located, I would get an error stating the following:

Unable to determine the workspace. You may be able to correct this by running 'tf workspaces /collection:TeamProjectCollectionUrl'.

Of course doing what it says didn’t fix the problem.

I use PowerShell for all my command-line tasks. So I then tried the same command from the location I have the project mapped on my machine. I received another error that said:

The term '.\tf' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

I was quite sure the path was set properly for the location of TF.exe and after many trials I actually checked the path and nope, the path was not set.

After adding the path to the TF.exe file to the system path. I was successful in running the TF utility from the location I had the project mapped on my machine. So the purpose of this post is to make sure you have the path to TF.exe in your system path, so you can use the TF utility easily.

Leave a Reply