@Martin Dráb I am able to copy tasks from branch X to Y and then checkin by Power Shell task in Azure Devops in diffrent pipeline, problem occurs only when I try to use commad “tf merges”.
I tried use Power Shell:
$tf = "C:\Program Files\Microsoft Visual Studio\2022\enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe"
$source = "$/XXX/ATE/Artifacts"
$target = "$/XXX/TST"
$changeset = "22302"
Write-Host "Merging $changeset"
Write-Host "Source: $source"
Write-Host "Target: $target"
tf merge `
"/version:$changeset~$changeset" `
"$source" `
"$target" `
/recursive `
/noprompt
if ($LASTEXITCODE -ne 0) {
throw "tf merge failed with exit code $LASTEXITCODE"
}
Write-Host "Merge completed successfully."
tf checkin `
/noprompt `
/comment:"Automated merge of changeset $changeset from X to Y"
if ($LASTEXITCODE -ne 0) {
throw "tf checkin failed with exit code $LASTEXITCODE"
}
Below I adding log from PS:
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a\_temp\120598a2-f488-45c6-9140-4b7c53ddc632.ps1'"
Merging 22302
Source: $/XXX/ATE/Artifacts
Target: $/XXX/TST
TF30063: You are not authorized to access https://XXX.visualstudio.com/.
tf merge failed with exit code 100
At D:\a\_temp\120598a2-f488-45c6-9140-4b7c53ddc632.ps1:22 char:5
+ throw "tf merge failed with exit code $LASTEXITCODE"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (tf merge failed with exit code 100:String) [], RuntimeException
+ FullyQualifiedErrorId : tf merge failed with exit code 100
##[error]PowerShell exited with code '1'