[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Powershell email - Need to have caarrage returns

Posted on 2014-03-05
2
Medium Priority
?
211 Views
Last Modified: 2014-03-06
The email works but everything is run together. I need a new line at the end of both test lines, some lines in between the two sets and new lines for each line in the txt files.

Any suggestions?


-BodyAsHtml `
    -Body  @"
      The Following Were tested and are up and can be logged into
     $(((Get-Content C:\MonitorFolder\ServersUp.txt) | out-string)
      
      
       "The Following Were tested and are either DOWN or CANNOT be logged into"
       ((Get-Content C:\MonitorFolder\ServersDown.txt) | out-string))
"@
0
Comment
Question by:jimmylew52
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 41

Accepted Solution

by:
footech earned 2000 total points
ID: 39908198
Either don't use the the -BodyAsHtml switch parameter, or remember that when you do use it your email is HTML and needs to be formatted accordingly.
An example with:
-BodyAsHtml `
    -Body  @"
      The Following Were tested and are up and can be logged into<br>
     $((Get-Content C:\MonitorFolder\ServersUp.txt) -join "<br>")
       <p>
       The Following Were tested and are either DOWN or CANNOT be logged into<br>
       $((Get-Content C:\MonitorFolder\ServersDown.txt) -join "<br>")
"@ 

Open in new window

0
 
LVL 1

Author Comment

by:jimmylew52
ID: 39909127
That worked. Thank You!!!!
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question