PowerTip: Use PowerShell to Find Files in Wrong Folder
Summary: Use Windows PowerShell to easily find files that are in the wrong folder.
I have a folder for documents and another folder for images. But at times, I discover images in the
documents folder. How can I use Windows PowerShell to easily detect this situation?
Use the Test-Path cmdlet, and specify the file extension to exclude, for example:
PS C:\> test-path c:\fso -Exclude *.bmp
PS C:\> dir c:\fso -Include *.bmp