I have in folder MyDocs, several sub-folders named Temp*. I wish to delete all the files in every Temp* sub-folder while keeping the sub-folders intact.
$dir = "C:\Users\Me\Documents\Temp*’
Get-Childitem -directory $dir |
Get-Childitem -file -recurse |
This works fine, but I also wish to have a list of the files deleted. In checking Remove-Item, the closest feature is the -Confirm parameter but this would become unwieldy if there are many files. Would appreciate some tips or guidance, thanks.