You want to do that the other way around.

For PowerShell to enumerate all files over and over again, it’s going to take forerever.

What you should do istead is

  1. Get all the files on D: (get-childitem “D:” -recurse)

  2. when run the CSV against the gathered data. (import-csv , foreach, where-object, -contains, etc.)

That should be pretty straight forward, give it a try.

If you get stuck post the code you have tried.

If you post code, please use the ‘Insert Code’ button. Please and thank you!

We’re happy to help but not a script writing service.

2 Spice ups