How to found if a TFS workspace is a local or server workspace

Question:

Is there a way to find out if a specific folder mapped in an existing tfs workspace is a local workspace or a server workspace?

I’m mostly interested by an answer using the tf.exe command or powershell or even api (but not with the GUI!).

Answer:

After a long search (hours and hours in the very bad msdn documentation about the tf.exe command!), I have found the way to get the information!

First you have to use the tf.exe workfold c:\your\path command to find out in which workspace the folder is. The command output something like that:

Then you have to extract the ‘workspace’ (note: we really don’t know why here the tf.exe command don’t output the workspace in the format accepted everywhere by the tf.exe command i.e. “WorkspaceName;Owner” and consequently should be adapted!) and ‘collection’ data to use it in the tf.exe workspaces /format:detailed command, like that:

The command output something like that:

The important data that I want here is Location : Local (or Server)

I have written a little powershell script, if it could be of little use for someone to extract the data in the output to use them:

This script give the answer only for the current folder but could be easily adapted…

Source:

How to found if a TFS workspace is a local or server workspace by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply