Local Workspace
You need to work with a local Workspace
. Here's how to manage workspaces:
visualstudio.com: "Create and work with workspaces".
When adding or editing the workspace you click Advanced >>
. Then you set Location:
to Local
.
Now when your script or anything else changes files outside Visual Studio, your workspace detects the changes
automatically.
It also detects adds
or deletes
but you have to include them to your Pending Changes
manually with the link under Excluded Changes

BUT BE CAREFUL. When adds
or deletes
get detected and you add them to your Pending Changes
, the files aren't automatically included to your project. So you maybe check them in to TFS
, but they aren't listed under the Solution Explorer
.
Matt Burke has a fix for that problem:
mattburkdev.com: "Automatically Include All Files in Folder in Visual Studio"
To edit the Project file you rightclick your project, chosse Unload Project
, then rightclick on it again and choose Edit
. After you edited the project files save and close it. Then rightclick and chose Load Project
.
But with that you also need to be careful, because the Project only searches for new files in these folders to include, when you load the project and not while you have the project open. So when some files get added outside Visual Studio, you just reload the project.
Server Workspace
But if you have to stick to a Server Workspace for some reason i got another trick for you:
FIRST:
Check out all Files that maybe have pending changes (better check out many files). Then go to Team Explorer -> Pending Changes and choose all files you just checked out. Then choose "undo changes". After this you get a message "Confirm Undo Checkout". This message ONLY pops up for the files, which actually HAVE changed! Press "NO" for each files or "No to All".
FINALLY: Under pending changes all files get removed from the list except the ones which have pending changes.
I hope I could help someone and you didn't have to search for this solution as long as I had to ^^