I'm hoping this is a fairly simple one. I have just discovered lots of orphaned files, due to colleagues (and myself - every day is a school day) not knowing that if you delete a database when it's offline it doesn't remove the associated files. I've got a list of these files, thanks to DBATools, however which is the best way to remove them, should I: a) delete the files by hand or b) recreate the database by attaching the files? Many thanks in advance for the advice.
The easiest way is to just delete them manually. No need to attach and then drop the database. I am not publicly recommending this, but if all you have on the drive or in the folder is supposed to be active db files, you could select all, and delete and ignore the in-use files. Have I done that before, yep, did I have issues no. Could it be an issue if someone had a detached database they planned to reattach, sure thing. However the shop I was working at, that wouldn't have been the case. So, sure, just delete the files you know aren't needed.