i want to map and checkIn a local folder which contains files into TFS using power shell scripting.
2 Answers
The sequence would be:
tf workspace /new
(Create a new workspace)
tf workfold /map
andtf 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
.

- 1
- 1

- 106,458
- 22
- 256
- 341
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

- 4,486
- 3
- 32
- 41