Created
January 19, 2011 04:57
-
-
Save jstangroome/785710 to your computer and use it in GitHub Desktop.
Download a file from TFS 2010 source control via PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can I download entire solution instead of a file