Liero February 2016

### Unable to determine the source control server on TFS build server

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

chief7 February 2016

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
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9724627733230591, "perplexity": 20258.03223775707}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-50/segments/1480698541187.54/warc/CC-MAIN-20161202170901-00228-ip-10-31-129-80.ec2.internal.warc.gz"}