Powershell Script Errors

May 12, 2013 at 2:25 AM
I am getting errors when I run the script. Any ideas?

Missing ')' in method call.
At line:6 char:35

Unexpected token 'Microsoft.TeamFoundation.Framework.Client.ITeamFoundationRegistry' in expression or statement.
At line:6 char:35

Unexpected token ')' in expression or statement.
At line:6 char:100
Jun 26, 2013 at 4:27 PM
try:
[Reflection.Assembly]::Load("Microsoft.TeamFoundation.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
$collectionBaseUrl = "http://localhost:8080/tfs/DefaultCollection/";
$tfs = [Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServer($collectionBaseUrl); 
$collectionHive = $tfs.GetService([Microsoft.TeamFoundation.Framework.Client.ITeamFoundationRegistry]);
$collectionHive.SetValue("/Inmeta/MergeEventHandler/Enabled", $True);
It looks like the casting wasn't being done properly. Also, the "True" variable wasn't being passed properly (missing $).

Hope that helps