1

Can anyone think of a way (perhaps using a PowerShell script or similar) where I can look for *.cs files that are on disk in the folder structure, but aren't included in a project file?

This has come about gradually over time with merging in Subversion etc. I'm looking for a way to clean up after myself, basically. :)

Neil Barnwell
  • 41,080
  • 29
  • 148
  • 220
  • The PowerShell script in my other post will do this for you. http://stackoverflow.com/a/23420956/846428. – jovball May 02 '14 at 05:03

3 Answers3

1

All your .cs files will be mentioned in the project file, right? Scrape the XML, list the files and then do a search on the whole system. Works, but is inefficient.

dirkgently
  • 108,024
  • 16
  • 131
  • 187
  • Yeah, efficient isn't an issue here for a once-every-now-and-again script. I was wondering what that script should look like though (my scripting-fu isn't much up to date than VBScript, so I might end up with a C# app...) – Neil Barnwell Feb 18 '09 at 13:55
  • Will try to whip something if I can, don't count on it though. As for an optimization that crossed my mind -- you can probably use two different threads, one to identify the files, another to delete identified files. – dirkgently Feb 18 '09 at 15:09
0

The PowerShell script in my other post will do this. The script will get the list of included files from the project file and compare that against the files on disk. You will get the set of files that are on disk but not included in the project. You can either delete them or pend them as deletes in TFS.

The script is here: https://stackoverflow.com/a/23420956/846428

Community
  • 1
  • 1
jovball
  • 126
  • 1
  • 6
0

"Show all files" button at the top of Solution Explorer, then manually inspect?

Richard Ev
  • 52,939
  • 59
  • 191
  • 278