How to control array output to HTML

This topic contains 2 replies, has 1 voice, and was last updated by Profile photo of Ali Hassan Ali Hassan 5 days, 17 hours ago.

  • Author
    Posts
  • #71060
    Profile photo of Ali Hassan
    Ali Hassan
    Participant

    Hi Guys,

    This is driving me mental! I cant seem to get the output of my array to an HTML page the way i want. Below is a snippet of my final line of code where my array $adm is being outputted to a HTML page.

    ConvertTo-Html –body "The below ADM's have been removed $($adm.toupper())" | Out-File -Append $report

    My $adm array has 3 elements in them and when the above line of code runs, I can see the output in one single line like:
    KAN2332 HSGS233 JHDS666

    I want it like:
    KAN2332
    HSGS233
    JHDS666

    Also not sticking to the left side of the page, in this possible? I dont seem to do this. I even tried exporting to csv as a test and it didnt give me anyone but the length value?! (Must be doing something wrong!)

    Any help?

    -A

  • #71065
    Profile photo of Ali Hassan
    Ali Hassan
    Participant

    I can do the below technique now, but the output is so ugly as all 3 elements stick to the left side of the page. Can it be formatted a little better?

    ConvertTo-Html –body "The below ADM's have been removed $($adm.toupper() -join "")" | Out-File -Append $report

    PS: For some reason the BR is not showing up in the code above within quotes at the end

  • #71066
    Profile photo of Ali Hassan
    Ali Hassan
    Participant

    Its fine. I did this and got everything to the center of the page! LOL

     ConvertTo-Html –body "The below ADM's have been removed $($adm.toupper() -join "")" | Out-File -Append $report

You must be logged in to reply to this topic.