I have Visual studio PowerTools installed and am trying to download the physical files that are associated with every changeset.
I can find all changesets associated with a file and downloaded the latest version of the file by performing the following:
$tfsServer = Get-TFSServer 'http://myserver/tfs'
$history = Get-TfsItemHistory -HistoryItem $tfsHistoryItem -Server $tfsServer
$tfsProjColl = Get-TfsProjectCollection -Uri $tfsRootUrl
$tfsVersionControl = $tfsProjColl.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer])
foreach ($h in $history)
{
$tempFilePath = [System.IO.Path]::GetTempFileName()
$item = Get-TfsItemProperty -Item $h -Server $tfsServer
$tfsVersionControl.DownloadFile($item.SourceServerItem, $tempFilePath)
}
At first, I thought I had it but SourceServerItem
simply is a reference to the same file which is the latest. How can I download the version of the file that was checked at that time?