OCGV ignores type data formatting and formats based off format data #235
Labels
bug
Something isn't working
Module-ConsoleGuiTools
This issue is about Microsoft.PowerShell.ConsoleGuiTools
OCGV
Prerequisites
Steps to reproduce
When working with a PSCustomObject that has type data for the default display of its properties, OCGV seemingly ignores it.
For the following:
The expected display inside OCGV would be the
DefaultDisplayPropertySet
(A, B), but instead it is the object in its entirety. I would have to guess that is because it's formatting based off of internal formatting rules for PSCustomObject and completely disregarding the type data associated with the customPSTypeName
in the object (which is why something likeGet-ChildItem
works fine with OCGV).The actual behavior is an inconvenience when working with a custom object that has a set of properties, some of which you would like to display, and some you would like to hide but keep inside the object for later processing in the pipeline. This means that
Select-Object
would not work in this instance, and messing with the*-FormatData
cmdlets would be overkill.If type data cannot be accommodated, maybe OCGV could have a parameter that sets the
-VisibleProperties
of an object, thus allowing you to neatly display just what you want inside OCGV, while still having access to the full object in the pipeline. For now, I just ignore the excess information when I use OCGV in my scripts.Expected behavior
Actual behavior
Error details
No response
Environment data
Version
7.6.0
Visuals
No response
The text was updated successfully, but these errors were encountered: