-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGet-TfsChanges.ps1
More file actions
36 lines (32 loc) · 1.32 KB
/
Get-TfsChanges.ps1
File metadata and controls
36 lines (32 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<#
.SYNOPSIS
This script will get all changesets from a specific date as well as all files that have changed since that date and write the results to two .csv files.
.PARAMETER sinceDate
The cutoff date for changes
#>
param (
[parameter(Mandatory=$true)]
[DateTime] $sinceDate
)
$tfsServer = (Get-TfsServer -Name nydevtfs01/NLY)
$changes = Get-TfsItemHistory -Recurse -HistoryItem C:\NLY |? {$_.CreationDate -gt $sincedate}
$changes |% {$_.Comment = $_.Comment -replace "`r`n", ""}
#$changes | Select-Object -Property ChangesetId, Owner, Creationdate, Comment | ConvertTo-Csv -NoTypeInformation > Changes.csv
$changeDetails = @()
$count = 0
$changesCount = $changes.Count
$changes |% {
$changeset = Get-TfsChangeset -ChangesetNumber $_.ChangesetId -Server $tfsServer
"Processing {0} of {1}. This changeset (ID {2}) has {3} change(s)." -f $count, $changesCount, $changeset.ChangesetId, $changeset.Changes.Count
$changeset.Changes |% {
$changeDetails += (New-Object PsObject -Property @{
"ChangesetId" = $changeset.ChangesetId;
"Owner" = $changeset.Owner;
"CheckinDate" = $_.Item.CheckinDate;
"ChangeType" = $_.ChangeType;
"ServerItem" = $_.Item.ServerItem
})
}
$count++
}
$changeDetails | ConvertTo-Csv -NoTypeInformation > ChangeDetails.csv