Quick tip today. I wanted to find all directories with a certain name specifically .vs because I wanted to delete them.
Is the .vs directory safe to delete? Yes, becuase its all generated files by VS that can be deleted. There is also db files in there that intellisense keeps, which can clutter your system after a while.
To find all files:
gci -recurse -Force -filter ".vs"
gcialias forGetChild-Item-recurseto search all sub-directories-Forceto search hidden and system files (this is useful for.vsdirectory because it is typically hidden)-filterto filter which directory or file we want
To get the full path of each result:
gci -recurse -Force -filter ".vs" | Select FullName
which will result in something like:
C:\proj\.vs\
C:\another-proj\.vs\
...
Now we can delete those directories.