Search code examples
powershellmergeazure-devopstfvc

TF Merge command in Powershell script task is not working


I am having powershell task with the following commands in my pipeline which is running using custom agent pool.

$TFFile = "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe"

$mergeCommand = " merge $/MyProject/dev $/MyProject/test /recursive"

Start-Process "$TFFile" "$mergeCommand"

$comment = "Automated merge check-in"

$CheckinToTarget = " checkin $/MyProject/test /comment:$comment /recursive /noprompt"

Start-Process "$TFFile" "$CheckinToTarget"

The pipeline is successfully running. But the changes in source branch is not merged with target branch. Please let me know what is missing in this scripts.


Solution

  • I am posting this solution to help others who are facing the issue like me. Using /loginType:OAuth with the command solves my issues.