Command/Workspace/TFS/CheckMergeConflicts.ps1


Import-Module CmxModule -Force -DisableNameChecking
SetWindowTitle $MyInvocation.MyCommand.Name

Write-Output "Check merge conflicts . . . "
$workspace = $LocalWorkspace
$changeset = "T"
# Write-Output "Changeset: $changeset"
# Write-Output "Workspace: $workspace"

Write-Output "Run PreviewGetLatestByVersion . . . "
$result = PreviewGetLatestByVersion -RootDir $workspace -ItemVersion $changeset
Write-Output "PreviewGetLatestByVersion has finished"

if($result.ExitedInTime -eq $false)
{
    Write-Output "The command [PreviewGetLatestByVersion] didn't exit it time!"
    exit 1
}

Write-Output ""
if($result.ExitCode -ne 0)
{
    # Write-Output ""
    # Write-Output "ExitCode: $($result.ExitCode)"
    Write-Output "Conflicts found: "
    Write-Output "$($result.StandardError)"
}
else
{
    Write-Output "No conflicts found."
}

Read-Host "The script has finished. Press any key to exit"