0
votes

What I'm trying to do should be simple - I want to get information for a single TFS workspace (in this case named the same as the computer name), and have that information returned via text - not via prompt window (it's my understanding this is what the /noprompt option is for). I am using the "workspace" command, and according to the official documentation (https://docs.microsoft.com/en-us/vsts/tfvc/workspace-command), it's not 100% clear this is supported.

Note:

  • I have tf.exe from Visual Studio 2017 and 2015 installed, and the 2015 Power Tools, but am preferring the 2017 client.
  • I've read the TF Workspaces question, and view this as something else - I specifically want the information about a single workspace (for a PowerShell script).
2
What makes you think it's not supported? And what's' your exact question? Using the Workspace command or the Workspaces command from tf is what you should use unless you want to use the VersionControlServer object directly from PowerShell.jessehouwing
I didn't say it wasn't supported; it's just not clear if it is, in the documentation. The workspace or workspaces commands don't give me what I want, at least in the format I'm looking for (text details for a single workspace).ryanwebjackson
Do you have a link to information about the VersionControlServer object? I don't think I've used it.ryanwebjackson

2 Answers

0
votes

The /noprompt option of tf.exe don't allow you to view details.

It allows you to create a new workspace or edit existing one, without the dialog.

0
votes

You can use the tfs client object model to query local workspaces. You can get the local workspaces through the workstation object https://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.workstation(v=vs.120).aspx

And you can use the version control server object to query additional details, fetch files, change the mapping etc https://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.versioncontrolserver(v=vs.120).aspx

This blog explains how to load the right assemblies, it references the 12.0 object model, I'd reccomend using the latest nuget packages instead. https://www.google.nl/amp/s/alistairbmackay.wordpress.com/2016/02/01/manipulating-tfs-with-powershell-part-1-connecting/amp/

Latest object model: https://www.nuget.org/packages/Microsoft.TeamFoundationServer.ExtendedClient/