user1443098
user1443098

Reputation: 7675

How can I find a file in TFS by name or part of a name or extension

In TFS, either using Visual Studio 2019 or the web interface, what should I do to locate a file by name or part of a name or extension? I have a large repository and I need to find a specific file, but it is not practicable to open each subfolder to try to find it visually.

Upvotes: 7

Views: 7114

Answers (2)

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51183

Updated

Since you are using TFS2013 and VS 2019 to find file without checking out the code locally.

  • Option1: Choose to install VS 2015 with TFS Power Tools and then use Find > Find by Wildcard feature
  • Option2: Upgrade your TFS server to version 2017 and above. There is a search sever/feature. Through the Code Search to search across all of your projects, find specific types of code, and easily drill down or widen your search

Workaround(not work with OP): use a wildcard directory path with TF DIR as follows:

tf dir /folders $/<PROJECT_NAME>/*Prod /recursive /collection: http://<HOST_NAME>/tfs/<COLLECTION_NAME>

Note: The command does not support wildcarding the PROJECT_NAME in the command above, if you try wildcarding the PROJECT_NAME the command will return the following response:

Sample and result for reference:

enter image description here

Without creds cached on your local machine. If you need to specify creds by adding the following argument: /login:<DOMAIN\USERNAME>,<PASSWORD>

Besides, if you already pull/map the repository in local machine with all files. You could also use a local tool or system build-in search feature to search the files.

Upvotes: 1

Eugene B.
Eugene B.

Reputation: 302

If you have Visual Studio 2015 or below, you will need to install TFS Power Tools for the corresponding VS version, and then you can open Source Control Explorer in Visual Studio, right-click on a root folder and select Find > Find by Wildcard from the context menu: enter image description here. You can then enter full or partial file name, and as long as it's under TFS source control, it will find it.

Upvotes: 0

Related Questions