tf.exe (Team Explorer) vs. tf.exe (Team Explorer Everywhere)

I recently had an interesting experiencing writing post build PowerShell script for a client. The client wanted to check in certain files into source control after the build is finished. Sounds easy, right? You can use either good old tf.exe command line utility from Visual Studio command tools. Or, you can use something more current like PowerShell to write a simple script that will check in pending changes for you. The problem is that the client also wanted to associate work items with the check in. Not a big deal, right? Well, apparently it is a big deal. You cannot associate work item with the check in using tf.exe command tool. And, what's even stranger, I could not find a way to associate work item with the check in using PowerShell. I got stuck with figuring out how to make WorkItemCheckinInfo[] parameter in Workspace.Checkin method to work properly.

This is how I learned that apparently you can associate work item with TFS check in, but you have to use tf.exe command from Team Explorer Everywhere. Apparently, even though the names are the same, those are very different command line utilities. When you use tf.exe from Team Explorer Everywhere, you can associate work item with the check in using a simple command:

tf checkin ItemSpec -associate:WorkItemIds

It's that easy. I just wish –associate option was available in common tf.exe command from Visual Studio command tools. I would also wish that those two seemingly identical tf.exe commands would actually do the same thing (the same way), or at least that those commands would have different names to avoid the confusion. By the way, there are also other differences between those two commands with the same names. You can get them form the links provided in the post. I'm too upset to list myself L