# \_\_ComObject formatting

**URL:** <https://forums.powershell.org/t/comobject-formatting/1965>\
**Category:** PowerShell Help\
**Created:** [October 16, 2013, 12:02am UTC](https://forums.powershell.org/t/comobject-formatting/1965 "2013-10-16T00:02:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![william-kempf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/william-kempf/32/933_2.png) [@william-kempf](https://forums.powershell.org/u/william-kempf)\
**Post date:** [October 16, 2013, 12:02am UTC](https://forums.powershell.org/t/comobject-formatting/1965/1 "2013-10-16T00:02:30Z")

</div>

Is it possible to use a ps1xml format specification to format specific COM object types? I’ve tried searching but the closest I’ve found was extending the base System.\_\_ComObject type to add functionality. I want to format a specific COM type.

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [October 16, 2013, 1:14am UTC](https://forums.powershell.org/t/comobject-formatting/1965/2 "2013-10-16T01:14:46Z")

</div>

Huh. I’ve never tried. In theory, if it shows a TypeName when you pipe the object to Get-Member, then you should be able to build a view on it. But without trying it, I can’t say for sure.

---

<div class="post-metadata">

**Author:** ![william-kempf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/william-kempf/32/933_2.png) [@william-kempf](https://forums.powershell.org/u/william-kempf)\
**Post date:** [October 16, 2013, 3:29am UTC](https://forums.powershell.org/t/comobject-formatting/1965/3 "2013-10-16T03:29:37Z")

</div>

Ah… I think I see how to do it. System.\_\_ComObject isn’t enough. Get-Member shows TypeName as System.\_\_ComObject#{Guid}, and that’s what I need to use. A quick test shows this to be the case. Stupid question, so thanks for helping me think about it more intelligently and arriving at the answer :).

---

<div class="post-metadata">

**Author:** ![richard-siddaway](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@richard-siddaway](https://forums.powershell.org/u/richard-siddaway)\
**Post date:** [October 16, 2013, 4:52am UTC](https://forums.powershell.org/t/comobject-formatting/1965/4 "2013-10-16T04:52:57Z")

</div>

In many cases the COM object is embedded in the returned object so you will need to unravel that to get to the point of being able to format the COM object. I would certainly think about the return on doing this - is it worth the effort?

---

<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:57pm UTC](https://forums.powershell.org/t/comobject-formatting/1965/5 "2024-05-16T20:57:35Z")

</div>


