One of the problems that comes with having multiple Team Project Collections and multiple Team Projects (in TFS) is the administrative burden required to upgrade or manage all of these projects. Security permissions, WIT modifications, configuration are all a 0..n problem so the more Team Projects you have, the more work it is, out of the box, to manage your TFS implementation.
There are numerous people and projects who have stepped up to help reduce this burden with applications, PowerShell scripts, and techniques for getting more work done with less effort.
One of those projects is Features4tfs, a command line application project that builds on a couple blog posts to make feature configuration easier when dealing with multiple TeamProjects.
Unfortunately, I've discovered that something happened between TFS 2015 RC and TFS 2015 RTM and this project no longer works. I've updated the code to use the latest RTM Object model binaries but I've just been unable to get it working. A few other people have run into this problem as well, and we've been unable to get any help or answers about this problem.
Regardless of getting help or not, I need to keep my client's migration/upgrade project moving forward and to that end, PowerShell, IE Automation and my recent work with the TFS 2015 Object Model in PowerShell to the rescue!
Implementing the Automate-IEConfigureFeatures Script
In order to understand this script, you'll need to make sure you understand what I'm doing with IE Automation and using a TFS PowerShell Module that I've discussed previously on this (and my) blog. I'll be using techniques from both those posts.
First, we need to enhance my TFS PowerShell module to add a cmdlet that it didn't have from the previous post.
Implement Get-TfsTeamProjects CmdLet
In this CmdLet, we build on our understanding of the TFS Object Model and, using the WorkItemStore, get a list of all TeamProject in a TPC and return that list from the cmdlet.
Composing our IE Automation Script
Luckily, the Feature Configuration page is simple, easily addressable, and behaves consistently so it is actually very easy to automate.
Now we're going to Import-Module (ipmo alias in PowerShell) my TFS PowerShell module. We'll use that functionality for connecting to TFS and getting the lists of TeamProjectCollections and TeamProjects. This Script is not going to be a cmdlet, so it isn't going to be as pretty (or well documented, or perhaps efficient) as the TFS module we've been using.
There is a function in this Script to help with quickly finding buttons that we're expecting on the TFS Web Access Admin page we're working on.
So that is it. I hope that the script is self-explanatory enough for you. I hope that you take away from this blog that there are usually many ways to solve a problem and sometimes we just have to roll up our sleeves and get our hands dirty and do our work in a functional and non-elegant manner. Don't let minor technical glitches get in the way of getting your work done.
There are the side benefits to this that you don't need to understand how the Feature Configuration works at a code level. You just need to be able to get your automation to click buttons.