I am trying to clear the 'Downloads' folder from all of our user profiles, the structure is:
I can't figure out how to empty the contents of the 'Downloads' folder from user profiles without having a separate line for each different username..
Batches like del "\\server\share\UPMProfiles\*\UPM_Profile\Downloads" don't work.
Any suggestions would be greatly appreciated.
You could use the wildcard and pipe the results to Remove-Item.
# Remember to remove -Whatif parameter when you're ready to actually delete them
# but the trick you were missing is the Foreach-Object
You must be logged in to reply to this topic.