Oh thank you, thank you TFS team!!! This is a great development because it enables version control queries for mere mortals (ie those of us not well versed in SQL Reporting Services). It also enables easily scriptable queries. With the October Team Foundation Power Tools drop, you get a PowerShell console icon in the start menu or you can just add the following to your profile:
Add-PSSnapin Microsoft.TeamFoundation.PowerShell
Once you’ve done that, here are the new cmdlets you get:
- Add-TfsPendingChange
- ConvertTo-FixedByte
- ConvertTo-FixedPath
- Get-TfsChangeset
- Get-TfsChildItem
- Get-TfsItemHistory
- Get-TfsItemProperty
- Get-TfsPendingChange
- Get-TfsServer
- Get-TfsShelveset
- Get-TfsWorkspace
- New-TfsChangeset
- New-TfsShelveset
- Remove-TfsPendingChange
- Remove-TfsShelveset
- Restore-TfsShelveset
- Select-TfsItem
- Set-TfsChangeset
- Update-TfsWorkspace
Now that you have the Team Foundation snapin loaded, you can start doing some interesting stuff like finding out who has pending changes older than 30 days:
PS> Get-TfsPendingChange . -User * -Recurse | |
Or say you want to see the level of checkin activity over the past 30 days:
PS> $history = Get-TfsItemHistory . -Recurse -Stopafter 1000 | |
If you have the excellent PowerGadgets, then you could do this:
PS> $history | group CreationDate | Out-Chart -Caption "Checkins/Day" -Size 480,320 -modal |
And get this nice graph:
Now if I’m a project manager on a large team, I might want to see “who” is checking in a bunch of code right before a deadline. That is easy enough:
67> $history | Group CreationDate | |
Querying is an especially powerful aspect of PowerShell and teamed with these new Team Foundation version control cmdlets, you have access to some interesting information.
psmdtag:snapin: Team Foundation Power Tools
psmdtag:snapin: TFPT