UpgradeWizard/Invoke-TFFolderDiffUW.ps1

function Invoke-TFFolderDiffUW
{
    Param(
    [Parameter(Mandatory=$true)]
    [string]$SourceFolder,
    [Parameter(Mandatory=$true)]
    [string]$TargetFolder
    )

    $ObjectDifferences = @()
    Create-EmptyDirectory -DirectoryPath 'C:\TEMP'
    $TempFile = Join-Path ('C:\TEMP\') -ChildPath 'FolderDiffResult.txt'
    $BatchFile = (Join-Path (Split-Path $TempFile -Parent) -ChildPath 'ExecuteFolderDiff.bat')
    [string]$Collection = '"/collection:{0}"' -f (Get-TFSCollectionURL)
    Add-Content -Path $BatchFile -Value ('"{0}" vc folderdiff "{1}" "{2}" {3} >> "{4}"'-f (Get-TFPath), $SourceFolder, $TargetFolder, $Collection, $TempFile)
         
    Start-Process -FilePath $BatchFile -WindowStyle Hidden -Wait

    $TempFileContent = Get-Content $TempFile
    $Matches = [Regex]::Matches($TempFileContent,'\D{3}\d{1,10}\.TXT')
    foreach ($Match in $Matches)
    {    
        if (!$ObjectDifferences.Contains($Match.Value))
        {
            $ObjectDifferences += $Match.Value
        }
    }

    $ObjectDifferences

    Remove-Item (Split-Path $TempFile -Parent) -Recurse -Force
}

Export-ModuleMember -Function Invoke-TFFolderDiffUW