TFS in PowerShell

 19 Sep 2014 -  Giulio Vian

I am re-factoring my PowerShell administration scripts and noticed many useful snippets to share, let’s start. Where is Team Foundation Server installed? Scenario: your script runs TFSSecurity.exe; sadly this tool is not in the path and, worse, the path changes from one Team Foundation Server version to another. The following function returns the Team Foundation Server path, e.g. C:\Program Files\Microsoft Team Foundation Server 12.0. function Get-TeamFoundationServerInstallPath { if (Test-Path "HKLM:\SOFTWARE\Microsoft\TeamFoundationServer") { $highestTFSversion = "{0:N1}" -f ( Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\TeamFoundationServer" | Split-Path -Leaf | foreach { $_ -as [double] } | sort -Descending | select -First 1) $tfsPath = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\TeamFoundationServer\$highestTFSversion" -Name InstallPath -ErrorAction SilentlyContinue if ($tfsPath) { $tfsPath.

Read more… ( ~3 Min.)

Team field fix after update 3

 18 Sep 2014 -  Giulio Vian

We are testing the upgrade to TFS 2013 Update 3. At first sight everything seemed working, but one reviewer, opening the Work tab to see the Backlog for her Team Project, saw this nasty TF400917 error I realized that, a while ago, around 2012.4, we have applied Customize a team project to support team fields   to that Project, and Custom.Team is our custom team field. What does Update 3?

Read more… ( ~2 Min.)

Why do you copy all those binaries?

 28 Jun 2014 -  Giulio Vian

Some days ago I replied to StackOverflow question “TFS 2010 Build, constant drop location, random access issue   ", and it reminded of an approach used in the past that revealed being effective. The scenario TFS Build creates a new folder in the Drop share at each new Build, no matter if it was successful or completely failed. The folder name is taken from the build identifier generated during the build run, e.

Read more… ( ~3 Min.)

Third upgrade in a row

 18 May 2014 -  Giulio Vian

Last week I upgraded our TFS infrastructure from 2013 to 2013 Update 2. It was the third upgrade since I started working in this company, which means 3 upgrades in 4 months! This says something about our Development Directors which want the latest features because they need them; it is also a consequence of Product Group’s innovation pace. Call me lucky. The DevOps movement keeps repeating: the harder to deploy, the more often you have to do it.

Read more… ( ~3 Min.)

A small nice touch from TFS 2013.2

 04 May 2014 -  Giulio Vian

No more fussing around to move the cache folder: TFS 2013 Update 2 add a nice link at your fingertips on the Administration Console. Now, I just need to find how to script this setting…

Read more… ( ~1 Min.)

Increment Version for Changed Assemblies only – Third Part

 28 Apr 2014 -  Giulio Vian

This is the third and last installment of the series: in the First post we examined the basics of extending the MSBuild / Visual Studio process, and in the Second part how to extend the Team Foundation Server Build, so that the minimum set of assembly is recompiled and gets the version updated. The limit of the latter solution is in the version number appearing in the assemblies: they have no relation with build identifiers.

Read more… ( ~4 Min.)

Increment Version for Changed Assemblies only – Second Part

 25 Apr 2014 -  Giulio Vian

In the previous post we have seen how to hook into the MSBuild process, common to both the Visual Studio and the Team Foundation Server build processes. Now we examine how to leverage the previous achievement in the context of TFS Build. We will examine the solution in a top-down fashion: first the build definition, than the build template, finally the MSBuild target file. The only drawback, is the lack of correlation between the version number appearing in the output assemblies with the Team Build Identifier; this will be correct with the next post .

Read more… ( ~4 Min.)

Increment Version for Changed Assemblies only – First part

 23 Apr 2014 -  Giulio Vian

This is something I did in the past (Build incrementale e numeri di versione [ITA]   ), and it came out recently on Stack Overflow   , so I will take the time to describe how to do this in details. The solution is design around MSBuild: leveraging some extension points, you trigger the custom code that increments some version number in AssemblyInfo.cs, subject to the same conditions that triggers code compiling.

Read more… ( ~4 Min.)

Remove TFS Feature

 09 Apr 2014 -  Giulio Vian

Are you shuffling around the machines of your TFS environment? Repurposing them? Changing the roles? Sometimes you need to remove some configured feature, like Build or Proxy. That’s easy to do in 5 simple steps. From the Administration Console, select the Server node (1), on the right panel click on the Remove Feature link (2), select the feature to un-configure (3), mark to enable the Remove button (4), finally press the Remove button (5).

Read more… ( ~1 Min.)

Build workspace issue

 02 Apr 2014 -  Giulio Vian

Some days ago, I got an email from a colleague about a build issue. Here is what she wrote me. Hi Giulio, After bringing back the build agents of ___, we’ve experienced below problem I’ve mentioned you this problem before, we’ve experienced the same when started to use ____ for first time. Only deleting the workspaces + physical folders fixed it. I know that many Build Master and TFS Administrators have seen the Unable to create the workspace ___ due to a mapping conflict.

Read more… ( ~2 Min.)