We use a batch file to generate code, and it automatically checks out the generated files from Team Foundation Server (TFS) so that it can regenerate them. The majority of these files are not modified, but the generator does not know this ahead of time.
The "tfs undo" command undoes the checkout, but prompts if some have been modified (which we don't want to do). We also do not want to check in the generated files right away.
Is there a command (or series of commands) to undo checkout of all unmodified files without prompting the user?
Take a look on Undo Unchanged command of the Team Foundation Server Power Tools August 2011
Thanks Matt Florence for link update.
Thanks Ray Vega for actual syntax.
Updated this question with an answer when working with TFS2017 and VS2017 only.
The power tools does not exist for TFS 2017 and the old ones can't work well together with it, but apparently most of the functionality has been moved to VS2017 itself or plugins (see below).
Visual Studio 2017 Extension
Some actions like undo unchanged files have moved to an extension for VS2017
"Undo Unchanged" button location:
Windows Shell Integration Extension
Also, you can still set up Windows shell integration through an separate installer which is no longer linked to TFS Power Tools.
The windows shell integration do not work exactly the same as the powertools before, but the most important actions worked for me.
Thank you @mike & @ray,
I wish to make it easier.
In VS, at Tools menu, click on "External Tools".
Click Add.
Enter title.
Command: tfpt.exe
Arguments: uu . /noget /recursive
Initial Directory: [you can choose from the arrow button].
Two new command are added to Tools menu.
Use them when needed.
Enjoy,
Ofir
Install Team Foundation Server Power Tools and run the following from the command line using tfpt.exe at the root of your project's workspace directory:
c:\myProject> tfpt uu . /noget /recursive
Including
/noget
is highly recommended since it prevents a forced 'get latest' of all your project's files which depending on the total number can take a extremely long time.