Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cls
- $tfsCollectionUrl = New-Object System.URI("http://localhost:8080/tfs/defaultcollection");
- [Microsoft.TeamFoundation.Client.TfsTeamProjectCollection] $tfsCollection = Get-TfsServer $tfsCollectionUrl
- $VersionControl = $tfsCollection.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer])
- $DestinationFile = [IO.Path]::GetTempFileName()
- $VersionControl.DownloadFileByUrl('$/MyFirstProject/WebApplication1/WebApplication1/WebForm1.aspx.cs', $DestinationFile)
- Invoke-Item $DestinationFile
- $tfsCollectionUrl = New-Object System.URI("[team project collection url");
- $username="[user name]"
- $password="[password]"
- $domain="[domain]"
- $cret = new-object System.Net.NetworkCredential($username, $password, $domain)
- $teamProjectCollection=new-object Microsoft.TeamFoundation.Client.TfsTeamProjectCollection($tfsCollectionUrl,$cret)
- $teamProjectCollection.EnsureAuthenticated()
- $VersionControl = $teamProjectCollection.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer])
- $workspace = $VersionControl.CreateWorkspace("BasicSccExamplePS", $VersionControl.AuthorizedUser);
- $workspace.Map("[file or folder server path, for example:$/TestTeam/FolderA]", "[local path]")
- $workspace.Get()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement