vkom
vkom

Reputation: 233

Get list of checked out files in TFS error

I'm trying to get a list of checked out / pending files in TFS through tf.exe command line.

When I run the powershell script

& "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\tf.exe" status /user:*

I do get the list of pending checked out files but it also gives me the error message as follow: tf.exe : Changes from local workspaces will not be displayed when using the /user option if a workspace is not supplied or if that workspace is on another machine...

Is there anyway to just get the list and not throw the error? I'm trying to use this script in a build server to check if any files have been manually checked out.

I know by switching to Server workspace this issue would not be present which is not an option at this point.

Thanks

Upvotes: 1

Views: 2370

Answers (1)

Keith Hill
Keith Hill

Reputation: 201652

You could redirect the stderr output to a log file e.g.:

tf status . /r /user:* 2>tf-status-err.log

You can also use the TeamFoundation PowerShell snapin that comes with the Team Foundation Server Power Tools.

Import-Module Microsoft.TeamFoundation.PowerShell
Get-TfsPendingChange . -Recurse -User * | Select -Exp PendingChanges | Format-List *

The PowerShell command is nice because you don't have to parse text like you would with the output of tf status.

Upvotes: 3

Related Questions