In some enterprises and even inside of Microsoft we often partition our drives in two sections. The OS and often used applications (this is often our C: drive) and the data and enlistment section (this is often the D:/ drive)
Recently, I received a question about what happens to the tf workspace cache when I reimage my OS drive and how I can get it repopulated again. Before we answer the question I think there is one core set of steps and then three scenarios on top of that which result in different actions from the user at the end.
In this case, there is nothing you have to do as a user. The workspace cache file will be regenerated automatically
Well in this case you do have to tell TFS version control that the machine name for this workspace has been changed. To do this you follow the documented syntax from msdn.
tf workspaces [/owner:ownername] [/computer:computername] [/server:servername] [/format:(brief|detailed)] [/updateUserName:oldUserName] [/updateComputerName:oldComputerName]
The command to execute is:
tf workspaces /server:servername /updateComputerName:oldcomputername
This is different from the first scenario because there is no UI that is triggering an automatic regeneration of the client cache file. In this case you need to force that to happen. For this will we again use the workspaces command. The syntax is:
tf workspaces /server:servername
There you have it ! How to reuse your workspace after a reinstalled.