TfsClientCredentials crd = new TfsClientCredentials(true);
Uri uri = new Uri(this.Context.ConnectionString);
TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(uri, crd);
ICommonStructureService css = (ICommonStructureService)tfs.GetService(typeof(ICommonStructureService));
ProjectInfo projectInfo = css.GetProjectFromName(this.Context.CommandParameters["ProjectName"].ToString());
String projectName;
String prjState;
int templateId = 0;
ProjectProperty[] projectProperties;
css.GetProjectProperties(
projectInfo.Uri, out projectName, out prjState, out templateId, out projectProperties);
Console.WriteLine(projectProperties[2].Value); //This will give you process template name
Refrence: Link
Uri uri = new Uri(this.Context.ConnectionString);
TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(uri, crd);
ICommonStructureService css = (ICommonStructureService)tfs.GetService(typeof(ICommonStructureService));
ProjectInfo projectInfo = css.GetProjectFromName(this.Context.CommandParameters["ProjectName"].ToString());
String projectName;
String prjState;
int templateId = 0;
ProjectProperty[] projectProperties;
css.GetProjectProperties(
projectInfo.Uri, out projectName, out prjState, out templateId, out projectProperties);
Console.WriteLine(projectProperties[2].Value); //This will give you process template name
Refrence: Link