PowerShell script to delete files from list and output list of deleted file
I think this should help.
Script:
$TargetFolder = “Pathofyourfolder”$Files = Get-ChildItem $TargetFolder -Exclude (gc List.txt) -Recurseforeach ($File in $Files) { write-host “Deleting File $File” -foregroundcolor “Red”; Remove-Item $File | out-null }