I am using the below code:
Get-ChildItem -Path N:\USERS -Filter DANTOM.DTM -Recurse -ErrorAction SilentlyContinue -Force
I need it to either find the file "DANTOM.DTM" or the extension ".DTM". I need to exclude the folder N:\USERS\EDI because it is a 1.7TB folder that would never have this file in it. So in doing so would really speed up the process.
I would like the end result to either spit into a .txt file saying which folders inside of N:\USERS has the file or just have it display as a list in powershell.
Thank you,
GCI C:\Users\* -Directory -Exclude 'EDI' | %{GCI $_ -Include DANTOM.DTM -Recurse -Force -EA 0}|Set-Content "$home\desktop\DTM Location.txt"
– TheMadTechnician