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

后端 未结 2 1773
难免孤独
难免孤独 2021-01-31 21:29

I\'m a novice with the PowerShell and TFS cmdlets and I\'m trying to retrieve a list of changesets in an area path, and their associated work items.

I\'ve got as far as

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-31 22:04

    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
        }
    }
    

提交回复
热议问题