Skip to content

Enhance Get-Member/Reflection Output with Colorization #14665

@StartAutomating

Description

@StartAutomating

Summary of the new feature/enhancement

It would be helpful to be see the output from Get-Member or from reflection in a color.

It would be even better if that colorization could support changes in the Windows Terminal color scheme.

Proposed technical implementation details

I'm pretty sure this could be accomplished with the build-in formatting engine. In fact, I've prototyped an example.

This is it running under the default color scheme of PowerShell in Terminal:
Start-Job {"brb"}| Get-Member  | Format-Table -View Get-Member-In-Color

This is it running under the 'Jackie Brown' color scheme of PowerShell on Kali-Linux on WSL:
[console] | Get-Member -Static | Format-Table -View Get-Member-In-Color

These are from EZOut, a module that produces .format.ps1xml and .types.ps1xml files. This module already has a couple of colorized views for reflection, visible with Format-Custom:

[string] | Format-Custom -view System.Type.Full

While these improve my own experience of using PowerShell, I think it would benefit PowerShell overall to include some formatting like this "in the box".

What would be needed to redefine the formatter for a given built-in type?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions