How to use TFS PowerShell to get list of changesets and associated work items? How to use TFS PowerShell to get list of changesets and associated work items? powershell powershell

How to use TFS PowerShell to get list of changesets and associated work items?


Yes, you're on the right track. Try this as a way to view workitems associated with a changeset:

Get-TfsItemHistory "$/Project/Branch" -Version "D01/12/10~" -Recurse |     Select ChangesetId -exp WorkItems |     Format-Table Id,Title -GroupBy ChangesetId -Auto


Using Microsoft.TeamFoundation.Client view https://stackoverflow.com/a/30047077/4051367

Usage

$versionControlServer.QueryHistory

$vCSChangeSets = $versionControlServer.QueryHistory($locationToSearch, $latest, 0, $recursionType, $userName, $versionFrom, $versionTo, [int32]::MaxValue, $true ,$false, $false, $true) $TargetChangeSetChangeItems = @()  $TargetChangeSetChangeItems = foreach ($vCSChangeSet in $vCSChangeSets) {       foreach ($vCSChange in $vCSChangeSet.Changes)     {         $vCSItem =  $vCSChange.Item         # MORE CODE HERE, OMMITTED    }}