Sendind compare-object's result by mail

Hi, I want to send a result of compare-object(Differences) by mail. How can I do this ?

Thank you

Ali,

with the cmdlet Send-MailMessage. Please read the help completely including the examples to learn how to use it.

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