TFS and PowerShell

It has been a while since we were able to write PowerShell scripts against TFS. For those who has not tried it yet, give it a shot. It's actually very easy to use and powerful tool. For those who has not tried PowerShell yet, I strongly encourage you to do that. There is no escape, PowerShell is everywhere J

Anyways, here is what you need to do to be able to write PowerShell script against TFS:

  1. Make sure you have PowerShell 3.0 installed or better. PowerShell is part of Windows Management Framework. To get PowerShell 3.0, you need to download and install Windows Management Framework 3.0 from https://www.microsoft.com/en-ca/download/details.aspx?id=34595. You might have to reboot your machine after this install.
  2. You also to download and install Windows PowerShell Cmdlets. This tool provides a Windows PowerShell interface that supports basic version control commands and a pipeline and glue to enable scripting. Windows PowerShell Cmdlets for TFS are part of Microsoft Visual Studio Team Foundation Server Power Tools that can be found at https://visualstudiogallery.msdn.microsoft.com/f017b10c-02b4-4d6d-9845-58a06545627f. Just make sure that you pick PowerShell component during the install.

That's it. Happy scripting.