Sometimes, when we need to quickly determine which files were changed across multiple changesets, we just want a list. We don’t want to have to open one work item check its changesets then go to another, etc. The following PowerShell script does just that.
Let me set the scenario. We use the Microsoft Visual Studio Scrum 1.0process template. In fact, now that we’re using TFS 2012 RC we upgraded our Team Project to using the Visual Studio Scrum 2.0process template. During our day-to-day we do work against Tasks that are associated to Bugs or Product Backlog Items. So, when we want to get a list of changed files, we want to simply point to the Bug or PBI. In the script below you just need to specify the $tfsUrl and $wiId attributes and execute the it.
The one drawback of the script is that it only works with 2-level, parent-child relationships. So, Bug-to-Task or PBI-to-Task. If you’re accustom to nesting these deeper then you will need to adapt the script accordingly.
We use the script internally to isolate changes when we want to either do a code review (a lot easier now with Visual Studio 2012) or when we want to isolate the files to package to send to a customer. Enjoy!