title: If time between 8:00 AM to 5:30 PM
body: <p>Can someone please mention how I can execute a sendmail function
  if the time is between 8:00 AM to 5:30 PM and for the 
  rest of the time not send mail ?</p>
  
  <p>Basically something like this pseudo works.</p>
  
  <pre><code>if(time between 8:00 AM and 5:30 PM)
  {
      send mail
  {
  else
  {
      do nothing
  }
  </code></pre>
  
  <p>More like this</p>
  
  <pre><code>[int]$hour = get-date -format HH
  If($hour -lt 8 -or $hour -gt 17)
  {
  </code></pre>