I have a script that grabs event log data and send the results in an email. The time stamp of an event log entry shows up correctly in non-24hour format...for example 2:30 PM and not 14:30.
However when I send the email, the message body contains the event date (as a variable) but this event date is converted to 24 hour format. I believe when the DateTime object is sent to the Send-MailMessage function, it must convert it to a STRING object for the message body.
Is there a way to prevent this or covert it back to non-24 hour format when adding it to the mail body variable?
Thanks
NK