This might be a starting point:
$Directories = "d:\test"
$OtherDirectory = "D:\OtherTest"
$TodaysDirectory = "D:\TodayTest"
$ThisDay = [datetime]::Today
$OtherFiles = 0
$TodaysFiles = 0
Get-ChildItem $directories |
ForEach-Object{
if ($_.Length -eq 0 -and $_.CreationTime.Date -ne $ThisDay){ # What about non-zero length files?
$OtherFiles++
Copy-Item . . .
}
elseif($_.Length -eq 0 -and $_.CreationTime.Date -eq $ThisDay){ # What about non-zero length files?
$TodaysFiles++
Copy-Item . . .
}
}
if (-not $TodaysFiles){
Clear-Host
Write-Host 'No files are found from today, and $OtherFiles old files were found'
Send-MailMessage -To support@contoso.com -From server@contoso.com -Subject "Something wrong" -Body $body -SmtpServer smtp.contoso.com
}
elseif($OtherFiles){
Clear-Host
Write-Host "found $OtherFiles old files, and $TodaysFiles current files"
Send-MailMessage . . .
}
else{
Clear-Host
Write-Host "$TodaysFiles are found from today, and $OtherFiles old files were also found"
Send-MailMessage -To support@contoso.com -From server@contoso.com -Subject "Something wrong" -Body $body -SmtpServer smtp.contoso.com
}