$purgePeriod = 30;
$folders = '\\FILSERVER01\ORDERS\BACKUP','C:\SFTP_BACKUP';
Get-ChildItem -path $folders | where {$_.Lastwritetime -lt (date).adddays(-$purgePeriod)} | remove-item;
Categories:
$purgePeriod = 30;
$folders = '\\FILSERVER01\ORDERS\BACKUP','C:\SFTP_BACKUP';
Get-ChildItem -path $folders | where {$_.Lastwritetime -lt (date).adddays(-$purgePeriod)} | remove-item;