So if i use this powershell script to delete files every 15 days it works great
$CutOffDate = (Get-Date).AddDays(-14)
Get-ChildItem -Path "Z:Programs" | Where-Object { $_.CreationTime -lt $CutOffDate } | Remove-Item
for one folder but what if I wanted a script where the url stays the same they only thing that changes is the username Z:ProfilesUsersonly this changesAppDataLocalTemp
is there a command or shortcut to ignore that part and search for the next link in the chain the AppData folder like a wild card command where the script will just go down the line in the files no matter what the username is?
basically I want to delete the contents of each users temp folder every 15 days and im not sure how to do it