Use robocopy in windows Here is like a script i used but more simplified
So i will make it in steps for you:
Step 1:Use Robocopy to List Files Modified Since Yesterday
/MAXAGE:$yesterdayDate: Lists files modified after midnight of the previous day. /L: Lists files without copying.
/S: Includes subdirectories.
/NJH, /NJS, /NS, /NC, /FP, /NDL: Suppress unnecessary output.
Step 2:process files Once you have the list of files, execute custom commands or scripts on them: Script Non-full
So on a side note: Robocopy is faster than Get-ChildItem for large directories because it avoids loading all that dumb file metadata upfront
Also files are one by one so it reduces memory overhead and to find like date YYYYMMDD since midnight of previous day
and some more technical stuff please replace Your target