Author Posts

May 18, 2017 at 11:30 pm

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

May 18, 2017 at 11:40 pm

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

May 18, 2017 at 11:46 pm

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