Created
June 10, 2016 15:00
-
-
Save adamdriscoll/712d130833256190e120b9e8882914ee to your computer and use it in GitHub Desktop.
TFS BranchObject from XML
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
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><QueryBranchObjectsResponse xmlns="http://schemas.microsoft.com/TeamFoundation/2005/06/VersionControl/ClientServices/03"><QueryBranchObjectsResult><BranchObject><Properties><RootItem it="$/SystemCenter/Main" ctype="8"><Version xsi:type="ChangesetVersionSpec" cs="7861" /></RootItem><Description>Converted to Branch after Code given by Adam</Description><Owner>adam@driscoll.com</Owner><OwnerDisplayName>Adam Driscoll</OwnerDisplayName><OwnerUniqueName>adam@driscoll.com</OwnerUniqueName><BranchMappings /></Properties><DateCreated>2014-12-17T15:48:34.037Z</DateCreated><ChildBranches /><RelatedBranches /></BranchObject></QueryBranchObjectsResult></QueryBranchObjectsResponse></soap:Body></soap:Envelope> |
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
[Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\wgyzjlaf.ik1\Microsoft.TeamFoundation.VersionControl.Client.dll") | Out-Null | |
$Reader = [Xml.XmlReader]::Create("$PSScriptRoot\Branch.xml") | |
while($reader.LocalName -ne "BranchObject" -and $reader.Read()) | |
{ | |
Write-Verbose "Skipping soap envelope" | |
} | |
while ($reader.NodeType -eq [System.Xml.XmlNodeType]::Element -and $reader.Name -eq "BranchObject") | |
{ | |
[Microsoft.TeamFoundation.VersionControl.Client.BranchObject]::FromXml($null, $reader) | |
} | |
$reader.ReadEndElement() | |
$reader.Dispose() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To collect the XML for a branch operation: