Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

No line breaks in Send-MailMessage body

$
0
0

Maybe someone will be able to point out what I am missing here.

I am trying to set up a task to send me a DFSR backlog report.  Nothing complex.  I have 4 groups and I just want the 4 lines below sent in the body of an email.

Problem I am running into is the output for the body of the email is showing up as a single line of text rather than 4 lines.

Get-DfsrBacklog -GroupName * -SourceComputerName "NC-COR-REP" -DestinationComputerName "NH-FS-03" -Verbose 4> "C:\SCRIPTS\verbose.txt" > null
$body = Get-Content "C:\scripts\verbose.txt" | Out-String
Send-MailMessage -to "Jay <j@company.com>" -from "Jay <j@company.com>" -subject "DFSR Backlog" -BodyAsHtml -body $body -smtpServer mail.company.com
Removing the Send-MailMessage outputs 4 lines.

Thanks


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>