Alan Stevens
2006-05-10 18:12:02 UTC
I am attempting to use PowerShell to make batch updates to workitems in team
foundation server. I have converted a C# program for the task, and have
gotten this far:
$key = gp HKLM:\SOFTWARE\Microsoft\VisualStudio\8.0
$dir = [string] (gp $key.InstallDir)
$dir+="PrivateAssemblies\"
$lib = $dir+"Microsoft.TeamFoundation.WorkItemTracking.Client.dll"
[Reflection.Assembly]::LoadFrom($lib)
$lib = $dir+"Microsoft.TeamFoundation.Client.dll"
[Reflection.Assembly]::LoadFrom($lib)
[Console]::WriteLine("Please enter your Team Foundation Server Name:")
$server = [Console]::ReadLine()
$server = $server.Trim()
"Connecting to " + $server + "..."
$tfs =
[Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServer($server)
The next line in the C# program is:
WorkItemStore store = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
I have so far been unsuccessful in passing the type object to the
GetService() method. How do I perform the equivalent of typeof() in
PowerShell? Any guidance would be greatly appreciated.
++Alan
foundation server. I have converted a C# program for the task, and have
gotten this far:
$key = gp HKLM:\SOFTWARE\Microsoft\VisualStudio\8.0
$dir = [string] (gp $key.InstallDir)
$dir+="PrivateAssemblies\"
$lib = $dir+"Microsoft.TeamFoundation.WorkItemTracking.Client.dll"
[Reflection.Assembly]::LoadFrom($lib)
$lib = $dir+"Microsoft.TeamFoundation.Client.dll"
[Reflection.Assembly]::LoadFrom($lib)
[Console]::WriteLine("Please enter your Team Foundation Server Name:")
$server = [Console]::ReadLine()
$server = $server.Trim()
"Connecting to " + $server + "..."
$tfs =
[Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServer($server)
The next line in the C# program is:
WorkItemStore store = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
I have so far been unsuccessful in passing the type object to the
GetService() method. How do I perform the equivalent of typeof() in
PowerShell? Any guidance would be greatly appreciated.
++Alan