Error when running the TFS Best Practices Analyzer with an account containing a dollar ($) sign

I recently tried to run the TFS BPA using an account containing a dollar ($) sign. It was something like "user$name".
I ended up with a rather strange error message looking like the following:

Cannot validate the URL provided The scan was generated using the corrected URL "%TFSServerURLValidated%".

A quick look at the "Other reports" section of the scan results, I found that the tool was trying to find files in the following directory:

c:\Users\user\AppData\Roaming\Microsoft\TfsBpa\[...]

The important part is highlighted.
It seems that some of the PowerShell scripts are analyzing the account name as the literal user followed by a variable named $name, instead of interpreting the whole account name as a literal.

As I didn't want to go through the various PS scripts in the BPA installation directory, I decided to take the lazy approach.
I created a symbolic link C:\Users\user pointing to C:\Users\user$name\ using the following command:

mklink /d \Users\user \Users\user$name

After that the BPA was able to perform the checks as expected.
Of course it is not a long term solution and it works only for my account, but still easier than scanning all the ps1 files to find the culprit.

Popular posts from this blog

Adding a delay before processing Textbox events

Handling exceptions the right way in WCF (part 2)

Create a draft release and start it using the TFS REST API