In a PowerShell script, I\'m capturing the string output of an EXE file in a variable, then concatenating it with some other text to build an email body.
However, w
Perhaps this helps:
$msg = "Output of other.exe: " + "`r`n" + ( (.\other.exe) -join "`r`n")
You get a list of lines and not a text from other.exe
$a = ('abc', 'efg') "Output of other.exe: " + $a $a = ('abc', 'efg') "Output of other.exe: " + "`r`n" + ($a -join "`r`n")