TFS 2013 Best Practices Analyzer (BPA) fails with %TFSServerURLValidated% error

Earlier this week I installed the Team Foundation Server 2013 Power Tools and went to run a BPA scan. It finished very quickly, giving me a couple of strange %TFSServerURLValidated% messages …

image

Viewing the report showed an additional warning “Cannot validate the URL provided”. I double-checked the spelling of my TFS URL, but it was fine. By selecting the “Other Reports” option, I was able to find the root cause …

image

So I began my research of the “Incorrect Windows PowerShell version 3.0. Windows PowerShell version 2.0 is supported in the current console.” error message and tried many things …

tempTried running BPA as Administrator (try the easy stuff first, right?)

tempCorrect versions of PowerShell were installed

tempPowerShell ExecutionPolicy was set to RemoteSigned

tempThe WinRM service was running and configured to support basic authentication

Still stumped, I reached out to some fellow Visual Studio ALM MVPs and Jason Stangroome gave me the answer, which I’m paraphrasing here …

“The error message is coming from within PowerShell. BPA is trying to add the “TfsBPAPowerShellSnapIn” snapin into the in-process PowerShell runspace but the snapin is reporting that it expects v3 of PowerShell whilst the BPA in-process runspace is hosting PSv2. On an OS with PowerShell v3 or later installed, switching between the two is performed by switching between CLR 2 and CLR 4. Checking the TFS BPA assemblies shows that they are compiled for CLR 2. So, either BPA needs to run under CLR 4, or the TfsBPAPowerShellSnapIn needs to report that it works with PSv2.”

Following Jason’s lead, I created a TfsBpa.exe.Config file in the C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools\Best Practices Analyzer folder and added these lines to it to force the CLR 4 to be used …

<configuration>
 <startup>
  <supportedRuntime version="v4.0.30319"/>
 </startup>
</configuration>

BPA is working great now …

image

Pin It

5 thoughts on “TFS 2013 Best Practices Analyzer (BPA) fails with %TFSServerURLValidated% error

  1. Just ran into the same problem. But if you copy/paste your sample to a new config file, then it wont work due to some character encoding issues. The double quotes in your sample is not valid in a config file.

Leave a Reply to Brian Dukes Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>