Hi All,Hope All is Well.I am new to powershell. I am trying to attach a txt file using the following in a ps file and it works well.Send-MailMessage -To <> -From <> -Subject "System Events" -Attachments "c:\scripts\sysevents.txt" -SmtpServer <>I need help in writing my logic using powershell where if the sysevents.txt is empty then it should not send email. It should only send email if the txt file has data in it.Thanks Much for your inputs.
↧