Mr. Boy
Mr. Boy

Reputation: 63738

In TFS, is it possible to create local workspace from a script?

MS' pages talk about using the command-line tf.exe to create a local workspace prior to calling tf get but describe that even from the command-line, a TFS dialog box will be shown.

One of our build scripts, as we move from VSS to TFS, gets a repo into a working copy prior to building. It would be preferable if this script can be run on a 'clean' PC and it automatically creates the local workspaces, or can somehow get a copy without using a workspace (we really need something closer to svn export as no changes are being made). But a dialog box requires we manually set up each machine with local workspaces first.

Is what I want possible?

Upvotes: 2

Views: 682

Answers (1)

Damien_The_Unbeliever
Damien_The_Unbeliever

Reputation: 239704

If you look at the full help tf help workspace, you see:

tf workspace /new [/noprompt] [/template:workspacename[;workspaceowner]]
             [/computer:computername] [/comment:("comment"|@commentfile)]
             [workspacename[;workspaceowner]]
             [/collection:TeamProjectCollectionUrl]
             [/permission:(Private|PublicLimited|Public)]
             [/login:username,[password]]

As you can see, you can specify /noprompt and all of the parameters that the prompt would collect.

For setting the working folder, you'd use tf workfold:

tf workfold /map serverfolder localfolder
            [/collection:TeamProjectCollectionUrl]
            [/workspace:workspacename]
            [/login:username,[password]]

Upvotes: 3

Related Questions