Provides all of the same functionality for finding SQL backups to remove from disk as a standard maintenance plan would.
As an addition you have the ability to check the Archive bit on files before deletion. This will allow you to ensure backups have been archived to your archive location before removal.
‘*.trn’ files in ‘C:\MSSQL\SQL Backup\’ and all subdirectories that are more than 48 hours old will be included.
Find-DbaBackup -Path ‘C:\MSSQL\SQL Backup\’ -BackupFileExtension trn -RetentionPeriod 48h
‘*.bak’ files in ‘C:\MSSQL\Backup\’ and all subdirectories that are more than 7 days old will be included, but only if the files have been backed up to another location as verified by checking the Archive bit.
Find-DbaBackup -Path ‘C:\MSSQL\Backup\’ -BackupFileExtension bak -RetentionPeriod 7d -CheckArchiveBit