How can I quickly check whether a folder contains a certain type of file?

A. You can pass the test-path cmdlet a wildcard expression to see whether any matching file exists. For example, to see whether a folder has any MP3 files, you can use

test-path d:\temp\*.mp3

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.