Setting up TFS and using it via the command line

This post assumes that a repository has already been set up.

    1. Download visual studio team explorer from the internet. The file is usually called vs_teamexplorer. Install team explorer
    2. Open visual studio. Typically, on the right of the Start Page you will see the Team Explorer. Click Manage Connections and connect to your repository
    3. Map the Local Path where you want your repository to reside
    4. You can click map and get, to get the latest version of your repository
    5. But, if you are like me and do not like the clunky tool that the team explorer is and prefer to work on the command line. Salvation is below 😉
    6. Click on the Environment Variables (as below) and open the Path environment variable
    7. Click edit on the Path variable. There are multiple ways to modify the path variable, you can do this also via the command line, but I prefer the visual manner that windows 10 offers. Add the following new file locations to the Path variable. These file locations will differ from system to system, based on where you installed team explorer. You can read more about these elsewhere. But important is to include these folders, important are the Scripts folder and the Team Explorer folder. Especially the team explorer folder, as it hosts the tf.exe file
      1. <DriveName>\Microsoft Visual Studio\2017\TeamExplorer\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer
      2. <DriveName>\AppData\Local\Programs\Microsoft VS Code\bin
      3. <DriveName>\Microsoft Visual Studio\2017\TeamExplorer\Common7\IDE
      4. <DriveName>\AppData\Roaming\Python\Python37\Scripts
    8. The tf.exe file is the key to operate your team foundation repository from the command line
    9. Now the interesting part! Open command prompt (Run à cmd)
    10. Change the path to your local directory (the one corresponding to step 3) e.g c:\projects
    11. Type in tf vc -help for a list of commands or refer to the official manual for a complete list à https://msdn.microsoft.com/en-us/library/ms181450(v=vs.80).aspx , https://msdn.microsoft.com/en-us/library/56f7w6be(v=vs.80).aspx