Welcome

What have you tried? Where are you stuck?

If you post code, please use the ‘Insert Code’ button. Please and thank you!

in theory:

Get-Childitem $parentFolder -Recurse  |
where-object {$_.lastAccessTime -lt (get-date).adddays(-30)} |
foreach{remove-item $_.fullname -recurse -force -verbose -whatif}

the ‘-30’ would not access in more than 30 days
what ‘-whatif’ shows you what it would delete, remove the ‘-whatif’ to actually delete stuff.

Make sure you have good backups before removing stuff :¬)

2 Spice ups