Question

i want to map and checkIn a local folder which contains files into TFS using power shell scripting.

Was it helpful?

Solution

The sequence would be:

tf workspace /new (Create a new workspace)

tf workfold /map and tf workfold /cloak (Map server folders to local folders)

tf get (optional to get the contents of the server folder)

tf add (Add the files/folders to the staging area)

tf checkin (check in the changes)

tf workspace /delete (optional to remove the (temporary) workspace)

If you need to merge/resolve conflicts, you can use tf resolve.

OTHER TIPS

TFS Powershell commandlets are available with Team Foundation Server Power Tools

These are available for all versions of TFS. Remember to install the PowerShell cmdlet options.

Once install, you would simply have to add Microsoft.TeamFoundation.Powershell snapin in your script

Add-PSSnapin Microsoft.TeamFoundation.PowerShell

You can then use the out of the box cmdslets such as Add-TfsPendingChange -Edit and New-TfsChangeset to add items and check-in

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top