I have a text file that is being read by powershell that has varying number of lines in it. I want powershell to read the lines and output to an email that lists each line on its own line.
The script below emails the lines all as one line and Ihave not been able to get it to show the line breaks.
Any help would be greatly appreciated.
$Line = Get-Content E:\MonitorFolder\PingResults.txt | Out-String
Send-MailMessage -From 'Lost_Network_Connection@company.com' -To 'email@example.com' `
-SmtpServer 'smtp.company.com' `
-Subject 'Lost Network Connection' `
$(($Line) + "'n")