2016-01-20 70 views
3

在Team Foundation Server 2015 Build(內部部署)中,我遇到了運行簡單命令行命令的問題。所有命令行任務都會失敗,並顯示以下錯誤:「文件未找到:」。TFS2015構建在'文件未找到'的所有命令行命令上失敗

就拿下面的生成定義:

BUILD FAILED 
2016-01-20T12:04:47.5127709Z ##[warning]Filename doesn't indicate a full path to a executable file. 
2016-01-20T12:04:47.5127709Z Executing the following commandline. (workingFolder = D:\_work\2\s) 
2016-01-20T12:04:47.5127709Z date 
2016-01-20T12:04:47.5127709Z Error message highlight pattern: 
2016-01-20T12:04:47.5127709Z Warning message highlight pattern:  
2016-01-20T12:04:47.5439748Z ##[error]File not found: date 

作者:

enter image description here

這是使用內部部署生成代理,並會失敗,並在日誌下面的異常執行當然這是一個簡單的例子,我只是想用date /t命令輸出當前日期。但是,我嘗試過的所有常規命令行命令都會出現同樣的問題,例如dir,timepath等。其上的MSDN does not provide any troubleshooting info除執行的工具必須駐留在PATH變量中外。

該問題並非特定於一個構建定義或回購;它也可以在其他人身上覆制。

該版本作爲內置的svc_tfsbuild帳戶運行。

我想這可能是一個簡單的設置,或者 - 瘋狂地猜測 - 與權利有關的問題,但找不到任何文檔在哪裏看或檢查什麼。任何幫助,將不勝感激。

回答

11

看起來這也是known issue on MS Connect

在短MSFT提到了以下幾點:

Commands that are built-in to command prompt don't work. Anything resolvable based on your PATH/PATHEXT will work.

在從2015年10月27日的評論中指出,這將是固定在未來的衝刺。現在提到的解決方法是首先執行cmd.exe,並將剩下的作爲參數提供。

使用從原來的問題的例子,這將導致:

Tool: cmd.exe 
Arguments: /c "date /t" 

而且我確實可以證實這一點的作品。