Hi there!
I wrote a script which gives me an overview of the existing databases and the free space of it.
It's all saved in an array and looks like this:
--- ------ ---------- ---------- ----------- -----------
1 AdventureWorks2012 221 31(14%) 75 71(95%)
I want this to be sent to an email address, but unfortunately the format of it is keeping me upset, because it looks like this:
Nr. DBName DBSize(MB) DBFree(MB) LogSize(MB) LogFree(MB)
--- ------ ---------- ---------- ----------- -----------
1 AdventureWorks2012 221 31(14%) 75 71(95%)
How can I edit the format of it ? Am I even able to add `t `r to the $body variable ?
I send it with following parameters:
$Body = $Body1 | Out-String $Encoding = [System.Text.Encoding]::UTF8 Send-MailMessage -From $From -To $To -Subject $Subject -Body $Body -SmtpServer $SMTP -Encoding $Encoding
So my question is: Is there any opportunity to format the array without formatting with html?
It's pretty hard do determine the values when it's more than 5 because the columns aren't in line.
- Edited by Scripting guy Streets Monday, July 27, 2015 9:17 AM