TF.exe - authentication

Copper Contributor

I am trying to automate TFS source control operations using TF.exe.

 

The page below says I can authenticate either with actual credentials or with a personal access token.

 

Use Team Foundation version control commands - Azure Repos | Microsoft Learn

 

However, this doesn't work with a basic test that attempts to list workspaces with either of the commands below:

 

TF.exe workspaces /collection:PROJECT_COLLECTION_URL /login:USERNAME,PASSWORD /noprompt

 

TF.exe workspaces /collection:PROJECT_COLLECTION_URL /login:PERSONAL_ACCESS_TOKEN /noprompt

 

I have also tried the format below after finding an article suggesting it:

 

TF.exe workspaces /collection:PROJECT_COLLECTION_URL /login:.,PERSONAL_ACCESS_TOKEN /noprompt

 

Still no joy.

 

The username and password I am using are definitely correct because I have tested them without /noprompt and copied and pasted them exactly.  I am 100% sure this is not a case of incorrect username/password.

 

The PAT I am using is a known working PAT that is definitely full access and active.  I am running code with it using both the old client libraries (for a variety of source control operations) and the new REST client libraries (for work item queries).

 

I cannot get the the "workspaces" command to execute with either credentials or a PAT.  What is the deal here?  Is the page above correct or not?  Does it just not work for some commands?

My ultimate goal is to be able to use TF.exe to create workspaces, run gets and check in/out automatically with no prompts.  Is this possible or not?

 

0 Replies