
Hello Team,
We are trying to automate the merging of two branches on TFVC (ADO), below is my snippet in powershell:
set-location c:\Temp\---
$comment= "checkin from A to B"
$commandLocation="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe"
$GetLatest="get $/A /force "
$Merge = "merge /force /version:T $/A $/B
$Checkin = " checkin /comment:$comment /recursive /noprompt ""C:\Temp\---""
#Get Lastest Files From Sources Control
Start-Process "$CommandLocation" "$GetLatest" -wait -RedirectStandardOutput c:\temp\Get-TFS.txt
#Merge and Checkin to Main
Start-Process "$CommandLocation" "$Merge" -nonewwindow -wait -RedirectStandardOutput c:\temp\Merge-TFS.txt
Start-Process "$CommandLocation" "$Checkin" -nonewwindow -wait -RedirectStandardOutput c:\temp\Checkin-TFS.txt
error getting after running this code:
Exactly two items (source and target) are required. Either local or server paths may be used.
Can anyone please help me on this! Thanks in advance!
Hi Shubham sethi,
Your question seems to be more related to Devops. Suggest to post a thread in the Devops forum for more help.
Please check: developercommunity.visualstudio.com/search
And you could find similar questions on the Internet:
social.msdn.microsoft.com/.../tf-merge-not-recognising-my-source-and-target
stackoverflow.com/.../unable-to-identify-workspaces-when-running-tfs-merge-command
Have a nice day.