0
votes

I've tried to run TFS command line in the Jenkins. However, I got this message error: unable to determine the workspace. You may be able to correct this by running "tf workspaces /collection:TeamProjectCollectionUrl".

  • I checked the workspace and it is correct. Ex.: tf workspaces
  • I checked the map and it is correct. Ex: tf workfold.

I ran the get command, informing the login and password and it didn't work in the Jenkins.

I ran this command in the powershell (outside jenkins) and the cmd worked well, however, If I ran get command (call via bat and powershell) in the jenkins, It didn't work.

Why did tfs commands work well outside the Jenkins and the Jenkins didn't?

Could anyone help me?

Thank you!

1
Did the Jenkins, powershell and cmd that you run tf command on the same machine? When you run tf commands in Jenkins, have you run in your workspace directory?Cece Dong - MSFT
Yes! I ran tf commands in the same machine! I didn't get workspace directory when the tf command run in Jenkins. I ran tf workspaces in jenkins and returned "tf workspaces No workspace matching * found on this computer"Kadu

1 Answers

1
votes

You could try to specify more parameters in your command line:

tf workspaces [/owner:ownername][/computer:computername][/collection:TeamProjectCollectionUrl][workspacename][/login:username,[password]]

I've tested with parameters /collection and /login in Jenkins, got a successful result:

enter image description here

enter image description here