Sendind compare-object's result by mail

Also, you should leverage ConvertTo-HTML and when using Send-MailMessage, use the -BodyAsHtml switch. There are many posts in this forum on these cmdlets and topics:

Send output of “Search-ADAccount” as body variable in SEND-MailMessage - PowerShell Help - PowerShell Forums

1 Like