Check in / out files on TFS via PowerShell

I would like to use PowerShell to automate the registration and registration of edited .csproj files in TFS. I only need to modify individual files pending and check them out.

Does anyone know how to do this?

+6
tfs powershell
source share
2 answers

You can check the New-TfsChangeSet and checkout using the Add-TfsPendingChange -Edit .

To get the cmdlets, you need to install Power Tools Microsoft Team Foundation Server 2010.

+7
source share

I had the same pain as you had, and finally got to the right path. Here you go.

 #Load the TFS powershell Add-PSSnapin Microsoft.TeamFoundation.PowerShell # the filePath should be in the format like C:\MyFodler\MyFile.txt Add-TfsPendingChange -Edit -Item $filepath -Verbose -ErrorAction SilentlyContinue -wa 0 # Check in the file after changes. New-TfsChangeset -Item $filepath -Verbose -Comment "Comment Here" -Override true 
+6
source share

All Articles