You can use the Get-ChildItem cmdlet to retrieve the files, and the Where-Object cmdlet to filter the files based on their age. You can then use the Remove-Item cmdlet to delete the filtered files

Get-ChildItem -Path C:\path\to\folder -Recurse -File | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-90) } | Remove-Item –Force -Verbose
Get-ChildItem -Path C:\inetpub\mailroot\Badmail -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt (Get-Date).AddDays(-30) } | Remove-Item -Force -Verbose