Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell to Find Files in Wrong Folder

$
0
0

Summary: Use Windows PowerShell to easily find files that are in the wrong folder.

Hey, Scripting Guy! Question 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?

Hey, Scripting Guy! Answer Use the Test-Path cmdlet, and specify the file extension to exclude, for example:

PS C:\> test-path c:\fso -Exclude *.bmp

True

PS C:\> dir c:\fso -Include *.bmp

PS C:\> 


Viewing all articles
Browse latest Browse all 3333

Trending Articles