Skip to content
ConsoleMonster
Cmdlet

Register-ConsoleView

Module ConsoleMonster
Inputs
None

Registers how a type is shown by Enable-ConsoleFormatting and Out-ConsoleDefault.

Syntax

Register-ConsoleView [-Group <String>] [-GroupBy <Object>] [-Property <Object[]>] [-Title <ScriptBlock>] [-TypeName] <String[]> [-View <ConsoleViewKind>] [<CommonParameters>]
#
Parameter set: Register
Register-ConsoleView -Remove [-TypeName] <String[]> [<CommonParameters>]
#
Parameter set: Remove

Description

Registers how a type is shown by Enable-ConsoleFormatting and Out-ConsoleDefault.

Objects whose type names include -TypeName are shown in the given view when they reach the console. -Property picks the columns as in Format-ConsoleTable (names, calculated properties with Presenter options), -GroupBy groups rows under headings, and types with the same -Group are shown together (files and folders). -Remove deletes a registration. Modules can register their own types when they load.

Examples

Authored help example

EXAMPLE 1

Register-ConsoleView -TypeName @('Name')

EXAMPLE 2

Register-ConsoleView -TypeName @('Name') -Remove

Parameters

-Group String optionalsets: Register
A group name: consecutive objects of types in the same group are shown in one view.
-GroupBy Object optionalsets: Register
A property name or script block that groups rows under headings.
-Property Object[] optionalsets: Register
The properties, as in Format-ConsoleTable.
-Title ScriptBlock optionalsets: Register
A script block for each object's title ($_ is the object): a shared title heads the view, different titles group the rows.
-TypeName String[] requiredposition: 0
The type names (as in PSObject.TypeNames).
-View ConsoleViewKind optionalsets: Register
The view: Table (default), Cards, Tree, Inspector or Chart.
Possible values: Empty, Text, Code, Inspector, Table, Cards, Tree, Chart, Grid
-Remove SwitchParameter requiredsets: Remove
Removes the registrations instead.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.