lining up columns

Welcome Forums General PowerShell Q&A lining up columns

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years, 2 months ago.

  • Author
  • #5482

    Points: 0
    Rank: Member

    by jgk-ps at 2013-01-29 10:42:22

    im probably missing something totally obvious but i cant figure this out out

    basically im running this command:

    Send-MailMessage -To -From -Subject "funky columns" -Body "$(get-process | out-string)" -SmtpServer

    and the in the email i get, the columns don't line up. its boarderline unreadable.

    by DonJ at 2013-01-29 10:59:02

    That's because PowerShell assumes you're using a monospaced font. It isn't intended to provide robust formatting, especially for proportional fonts.

    Instead of Out-String, use ConvertTo-HTML. Then add the -BodyAsHTML (I'm not in front of a shell – that's probably the wrong parameter name, but there's something similar). That'll give you an HTML table, which will leave everything lined up.

    by jgk-ps at 2013-01-29 11:06:27

    lo and behold, it was totally obvious in hindsight

    thanks don

The topic ‘lining up columns’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort