# Custom PSobject HTML output

**URL:** <https://forums.powershell.org/t/custom-psobject-html-output/11319>\
**Category:** PowerShell Help\
**Created:** [September 17, 2018, 7:14am UTC](https://forums.powershell.org/t/custom-psobject-html-output/11319 "2018-09-17T07:14:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![j2sankha](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@j2sankha](https://forums.powershell.org/u/j2sankha)\
**Post date:** [September 17, 2018, 7:14am UTC](https://forums.powershell.org/t/custom-psobject-html-output/11319/1 "2018-09-17T07:14:30Z")

</div>

Hello Team,

My PS Custom object concept is not very clear. So need your help to understand and fix the issue. I want to create a system report which contains multiple information. Following is an example code. I am holding multiple objects’ output in a custom object and trying to convert it in HTML, but the result is not showing as I am expecting. I am expecting what I see in the console by enumerating each property should be in HTML file like that. I am definitely sure that I have some conceptual mistakes. But need your support to rectify those.

```
$hstbl = @{}

$hstbl.Add('RunningSrvs',(gsv -name [a-b]*|select DisplayName, Status |ft -AutoSize))

$hstbl.Add('RunningProcs',(gps -name [a-f]*|? cpu -gt $null |select Name, CPU |ft -AutoSize))

$obj = New-Object PSCustomObject -Property $hstbl
```

I tried for HTML output,

```
$obj.RunningSrvs|ConvertTo-Html | Out-File C:\test.html

$obj.RunningProcs|ConvertTo-Html | Out-File C:\test.html -append
```

By doing this, getting some kind of wired HTML output.

Eagerly waiting for your input, please help…

Regards,

Roy.

---

<div class="post-metadata">

**Author:** ![sam-boutros](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/sam-boutros/32/5_2.png) [@sam-boutros](https://forums.powershell.org/u/sam-boutros)\
**Post date:** [September 17, 2018, 8:18am UTC](https://forums.powershell.org/t/custom-psobject-html-output/11319/2 "2018-09-17T08:18:25Z")

</div>

```
Get-Service -name [a-b]* | select DisplayName, Status | ConvertTo-Html | Out-File .\Report1.html

'(p)(hr)(p)' | Out-File .\Report1.html -Append # replace brackets with html tag characters that won't show here

Get-Process -name [a-f]* | where cpu | select Name, CPU | ConvertTo-Html | Out-File .\Report1.html -Append

& .\Report1.html
```

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:34pm UTC](https://forums.powershell.org/t/custom-psobject-html-output/11319/3 "2024-05-16T20:34:25Z")

</div>

Closed on May 16, 2024, 8:34pm UTC


