# ConvertTo-HTML changing output

**URL:** <https://forums.powershell.org/t/convertto-html-changing-output/3994>\
**Category:** PowerShell Help\
**Created:** [April 8, 2015, 2:19am UTC](https://forums.powershell.org/t/convertto-html-changing-output/3994 "2015-04-08T02:19:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff-lovell](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@jeff-lovell](https://forums.powershell.org/u/jeff-lovell)\
**Post date:** [April 8, 2015, 2:19am UTC](https://forums.powershell.org/t/convertto-html-changing-output/3994/1 "2015-04-08T02:19:39Z")

</div>

Hello! I am pulling health data from a HP server using GWMI and it brings back the expected data if I just run ir, but when I go to use ConvertTo-HTML the info changes. Here is the code I am using;

```
gwmi HP_PowerSupply -Namespace root/HPQ | where-object {$_.DeviceID -eq 'Power Supply 2'} | Select StatusDescriptions
```

This yields

## StatusDescriptions

{Power Supply is operating properly}

When I add a pipe and ConvertTo-HTML -Fragment the output changes to

```
*
System.String[]
```

So the column header changes to just an \* and the actual data is now System.String

Ideas? Thanks!!

Jeff

---

<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:** [April 8, 2015, 3:18am UTC](https://forums.powershell.org/t/convertto-html-changing-output/3994/2 "2015-04-08T03:18:25Z")

</div>

ConvertTo-HTML -Fragment is expecting string but is getting an object. Try:

```
(gwmi HP_PowerSupply -Namespace root/HPQ | where-object {$_.DeviceID -eq 'Power Supply 2'}).StatusDescriptions
```

and pipe that to ConvertTo-HTML -Fragment

---

<div class="post-metadata">

**Author:** ![jeff-lovell](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@jeff-lovell](https://forums.powershell.org/u/jeff-lovell)\
**Post date:** [April 8, 2015, 5:42am UTC](https://forums.powershell.org/t/convertto-html-changing-output/3994/3 "2015-04-08T05:42:40Z")

</div>

Thanks!!! I also found out I could bracket the StatusDesccriptions. Once I thought about it that is what I figured was happening.

Jeff

---

<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:46pm UTC](https://forums.powershell.org/t/convertto-html-changing-output/3994/4 "2024-05-16T20:46:16Z")

</div>

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


