Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. cls
  2. $tfsCollectionUrl = New-Object System.URI("http://localhost:8080/tfs/defaultcollection");
  3. [Microsoft.TeamFoundation.Client.TfsTeamProjectCollection] $tfsCollection = Get-TfsServer $tfsCollectionUrl
  4. $VersionControl = $tfsCollection.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer])
  5. $DestinationFile = [IO.Path]::GetTempFileName()
  6. $VersionControl.DownloadFileByUrl('$/MyFirstProject/WebApplication1/WebApplication1/WebForm1.aspx.cs', $DestinationFile)
  7.  
  8. Invoke-Item $DestinationFile
  9.  
  10. $tfsCollectionUrl = New-Object System.URI("[team project collection url");
  11.  
  12. $username="[user name]"
  13. $password="[password]"
  14. $domain="[domain]"
  15. $cret = new-object System.Net.NetworkCredential($username, $password, $domain)
  16. $teamProjectCollection=new-object Microsoft.TeamFoundation.Client.TfsTeamProjectCollection($tfsCollectionUrl,$cret)
  17. $teamProjectCollection.EnsureAuthenticated()
  18. $VersionControl = $teamProjectCollection.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer])
  19. $workspace = $VersionControl.CreateWorkspace("BasicSccExamplePS", $VersionControl.AuthorizedUser);
  20. $workspace.Map("[file or folder server path, for example:$/TestTeam/FolderA]", "[local path]")
  21. $workspace.Get()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement