Skip to content

Instantly share code, notes, and snippets.

@jstangroome
Created January 19, 2011 04:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstangroome/785710 to your computer and use it in GitHub Desktop.
Save jstangroome/785710 to your computer and use it in GitHub Desktop.
Download a file from TFS 2010 source control via PowerShell
$CollectionUrl = 'http://localhost:8080/tfs/defaultcollection'
Add-Type -AssemblyName 'Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Add-Type -AssemblyName 'Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
$Collection = New-Object -TypeName Microsoft.TeamFoundation.Client.TfsTeamProjectCollection -ArgumentList $CollectionUrl
$VersionControl = $Collection.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer])
$DestinationFile = [IO.Path]::GetTempFileName()
$VersionControl.DownloadFile('$/Test/BuildProcessTemplates/DefaultTemplate.xaml', $DestinationFile)
Get-Content -Path $DestinationFile
@Github743
Copy link

How can I download entire solution instead of a file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment