I want to read a mailbox and locate an email that I've recently sent.
I have a variable that defines how many days should pass before it is resent.
My logic was working okay, but today I found one from last month, and it has been 28 days since it was first sent.
That means that my logic below is calculating (14 - (today - when sent)), which equals -28, giving me a 0 for the result.
My compare logic only 're-notifies' if that value ($DaysSinceNotice) is -le 0. But now I'm second-guessing myself and would like advice from the collective hive mind. ;^)
$DaysSinceNotice = ($RenoticeFrequency - ($(get-date).date.Subtract($LastSent).days)) % $RenoticeFrequency