#Change the limit date to custom number of days. Currently set to any backup older than 15 days. $limit = (Get-Date).AddDays(-15) #Specify path of the PSE Backups $PSEpath = "D:\Backups\PSO_Backups" # Delete PSE backups older than the $limit. Get-ChildItem -Path $PSEpath -Recurse -Force | Where-Object {!$_.PSIsContainer -and $_.CreationTime -lt $limit } | Remove-Item -Force