views:

395

answers:

2

Is there any way to easily create a workspace, based on a pre-existing "template" one? ...or some other way of creating workspace on behalf of others?

+5  A: 

you can create a workspace using a command script using the tf workspace command. Then you can map work folders using the tf workfold command. The workspace command has a /template option

For example:

to create a workspace for someone

tf workspace /new Beta1;jenh

then create a new one based on the template

tf workspace /new /template:Beta1;jenh /server:teamserver2 Beta1;user2

to map a folder:

tf workfold /map $/projects/project_one C:\localproject1 /workspace:Beta1;user2
Preet Sangha
+1 Nice summary.
Richard Berg
Only caveat I'd add to this, is that you can't do this on the machine that the template refers to, as you get an error that the folders are already mapped.
Rowland Shaw
Yes as you only may one folder in one workspace to one machine
Preet Sangha
A: 

You can also copy and paste the workspace mappings from one workspace into another.

  1. Edit the template workspace.
  2. Select the mappings you want to copy.
  3. Press Ctrl+C
  4. Create a new Workspace (or edit an existing one)
  5. Tab into the Working folders grid.
  6. Press Ctrl+V

You can also paste the mappings into Notepad, update them and, copy and paste them back into the workspace editor.

The format you'll see in notepad: :

Example: $/TeamProj1/Trunk/: C:\TFS\WorkingFolder\

BubbleSort