0
votes

How to use TF history command line on tfs 2013 build server?

when I try to call command line tf history C:\Builds\1\MyProj\MyBuild\src\Dev on tfs build server I get:

There is no working folder mapping for "C:\Builds\1\MyProj\MyBuild\src\Dev`

When I try powershell Get-TfsItemHistory C:\Builds\1\MyProj\MyBuild\src\Dev on tfs 2013 build server, I get:

Unable to determine the source control server.

When I open visual studio on build server and in Team Explorer I try to configure workspace mapping to the folder , I get:

"The working folder C:\Builds\1\MyProj\MyBuild\src\Dev is already in use by the workspace 10_1_MHATFSBLD01;MHABLDSvc on computer MHATFSBLD01."

*MHA is name of team project collection

1
are you logged on to the machine as yourself or the service account that the build agent runs under?James Reed
I've got this message in both cases, from build log produced by build agent running as service account and when trying to run the script manually from my accountLiero

1 Answers

1
votes

Regarding the "no working folder error", you need to set the server:

 $tfs = get-tfsserver "http://server:8080/tfs/collection"
 Get-TfsItemHistory '$/YourTeamProject/MyProj/src/Dev' -Server $tfs

Obviously, you will need to adjust this for your specific TFS source structure.

Regarding the issue with the build not recognizing the TFS cmdlets, try your command in the Windows PowerShell x86 command prompt on the build agent. If it still fails you need to install the TFS cmdlets and/or fix PowerShell to run in 32 bit mode. See stackoverflow.com/questions/35292971