{"id":4223,"date":"2006-02-24T08:25:00","date_gmt":"2006-02-24T08:25:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/buckh\/2006\/02\/24\/listing-the-process-templates-on-a-tfs-server\/"},"modified":"2006-02-24T08:25:00","modified_gmt":"2006-02-24T08:25:00","slug":"listing-the-process-templates-on-a-tfs-server","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/buckh\/listing-the-process-templates-on-a-tfs-server\/","title":{"rendered":"Listing the process templates on a TFS server"},"content":{"rendered":"<p>In response to a <a href=\"http:\/\/forums.microsoft.com\/MSDN\/ShowPost.aspx?PostID=254335&amp;SiteID=1\">forum question<\/a> about how to list the process templates on the server, Tony Edwards, a developer on Work Item Tracking, posted the following&nbsp;code snippet showing how to do it.&nbsp; The TeamFoundationServer object provides a number of services, including one for dealing with process templates.<\/p>\n<blockquote>\n<p>Here is&nbsp; a simple console program to list the templates.&nbsp; IProcessTemplate has members that return XML &#8211; you could bind that to the grid.&nbsp; You would invoke the sample below as follows:<\/p>\n<p>templateheaders http:\/\/&lt;your_server&gt;:8080<\/p>\n<p>using System;<br>using System.Collections.Generic;<br>using System.Text;<br>using Microsoft.TeamFoundation.Server;<br>using Microsoft.TeamFoundation.Client;<\/p>\n<p><br>namespace TemplateHeaders<br>{<br>&nbsp;&nbsp;&nbsp; class Program<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; static void Main(string[] args)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TeamFoundationServer tfs = new TeamFoundationServer(args[0]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IProcessTemplates templates = <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (IProcessTemplates) tfs.GetService(typeof(IProcessTemplates));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TemplateHeader [] headers = templates.TemplateHeaders();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (TemplateHeader header in headers)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine(header.Name);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}<\/p>\n<\/blockquote>\n<p dir=\"ltr\">If you haven&#8217;t built&nbsp;a code sample before, you can find instructions on adding the TFS assemblies to the .NET tab in VS <a href=\"http:\/\/blogs.msdn.com\/buckh\/archive\/2006\/01\/12\/511886.aspx\">here<\/a>.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In response to a forum question about how to list the process templates on the server, Tony Edwards, a developer on Work Item Tracking, posted the following&nbsp;code snippet showing how to do it.&nbsp; The TeamFoundationServer object provides a number of services, including one for dealing with process templates. Here is&nbsp; a simple console program to [&hellip;]<\/p>\n","protected":false},"author":94,"featured_media":10268,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[8,15],"class_list":["post-4223","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-team-foundation","tag-tfs-api"],"acf":[],"blog_post_summary":"<p>In response to a forum question about how to list the process templates on the server, Tony Edwards, a developer on Work Item Tracking, posted the following&nbsp;code snippet showing how to do it.&nbsp; The TeamFoundationServer object provides a number of services, including one for dealing with process templates. Here is&nbsp; a simple console program to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts\/4223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/users\/94"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/comments?post=4223"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts\/4223\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/media\/10268"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/media?parent=4223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/categories?post=4223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/tags?post=4223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}