Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Create line break in string/message

$
0
0

Hi guys, I'm using powershell to send an email which works fine, however I'd like to reformat the body a little.

I have a number of PC names in the array which I then join.

 

$merge = $PCs_in_array -join ", "

$body = @"

"Hello, these are the PCs in the list:"

$merge

"You will receive another email in 2hrs"

"@

 

The email looks like this at the moment:

Hello, these are the PCs in the list:

PC1, PC2, PC3, PC4

You will receive another email in 2hrs

 

What I'd like it look like:

Hello, these are the PCs in the list:

PC1

PC2

PC3

PC4

You will receive another email in 2hrs

 

How do I create that line break for each PC?


Viewing all articles
Browse latest Browse all 6937

Trending Articles