Find files and folders

Find files and folders

Recently I needed to find all files and folders containing two spaces, normally I would use something like a file renamer but in this case for various reasons I just needed to generate a list. Eventually I ended up figuring out a PowerShell command to do it.

Here’s the code I used to do it

get-childitem -recurse | where-object {$_ -match '  '} | select-object FullName | export-csv -notypeinformation -delimiter '|' C:\file.csv
Code language: PowerShell (powershell)

The same code can be used to find anything. Just replace the two spaces with whatever you need to find.

Leave a comment

Your email address will not be published. Required fields are marked *