title: Powershell - Send email when number of days reaches a set interval
body: <p>I'm at a blocker and need some help!</p>
  <pre><code>(New-Timespan -Start (Get-Date) -End (Get-AdfsCertificate -CertificateType Token-Signing | where-object { $_.IsPrimary -eq $true }).Certificate.NotAfter).Days
  </code></pre>
  <p>This returns a result of days until it is no longer a primary certificate. E.G simply &quot;141&quot;</p>
  <p>How can I implement a way of looking at this result and sending an email when it reaches a certain day? E.G 20 days until it is no longer primary.</p>
  <p>I can use a mail relay, so no credentials are required!</p>
  <p>Many thanks in advance!</p>