Monday, September 14, 2015

TFS Power Tool & Powershell Cmdlets



Use Power Tools to enhance Visual Studio experience-

A- Microsoft Visual Studio Team Foundation Server 2013 Power Tools-

We can use PowerShell Cmdlets to automate some of the repeating tasks that we do in tfs.
You need to install PowerTool for the TFS on your machine. To install TFS 2013 power tool for visual studio 2013 download the installer from this link.
While installing remember to include PowerShell Cmdlets as by default this is unselected in installer.


This tool provides a Windows PowerShell interface that supports basic version control commands and a pipeline and glue to enable scripting. Use this tool to create new work items with default values, or to easily apply values to existing work items.
Once you have Cmdlets on your machine you can play with powershell and TFS.


Start using powershell Cmdlets –
For administrative tasks, you'll want to launch Windows PowerShell as an administrator. And as long-time Windows PowerShell users already know, if you want to enable the execution of remote scripts, make sure that you set your script execution policy to RemoteSigned.


Add snap in in PowerShell before you start using commands of Cmdlets as shown below. Get-help will show you different Cmdlet available to play around.



  - There are some more Power Tool commands that could be handy-



Some examples of using these PowerShell to automate your tasks-
1- We can automate task creation for PBI’s that we have in each sprint. Below script will add one testing task in all the PBI’s that you enter in the $PBIs variable. You can modify the script as shown in the blocks below and run the script to add the PBI’s easily.




2- Get all Feature branches who have their name as PBI number. Then look the status of PBI, if it is in done status then drop a mail to PBI assignee. I am not showing the whole script here but it could be achieved by using below commands-
$tfs = Get-TfsServer -name http://tfs.ds.adp.com/SERVICEEDGE_COLLECTION1
$tfsSource = Get-TfsChildItem "$/TFSProject/Features/" -Server $tfs

Now you can iterate through $tfsSource for all the branches name and fetch the PBI assignee to drop a mail to him through SMTP.


B - Productivity Power Tool for Visual Studio-
There is also one productivity power tool for visual studio which could help in finding build errors and warning and has many more exciting features for developers to use. Download and read its features from this link.

Watch this video for Productivity power tool-




2 comments:

  1. There is also power shell example which wll help you to add tasks in PBI's in tfs

    ReplyDelete
  2. ince you're ready to append the boring material to the press, you can be more precise with the opening arrangement than you can with a consistent hand held bore.

    http://www.drillpresspro.com

    ReplyDelete