Skip to content
ConsoleMonster
Cmdlet

New-ConsoleAccordion

Module
ConsoleMonster
Outputs
ConsoleMonster.Interactive.Accordion

Creates an accordion for Show-ConsoleApp: collapsible sections that keep one open.

Syntax

New-ConsoleAccordion
[-Content] <Object>
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

-Content emits New-ConsoleCollapsible sections. Opening one folds the others; while a header has focus, + expands every section for reading and - folds them all. Each section keeps its own key and state.

Examples

Example 1

Show-ConsoleApp -Content {
    New-ConsoleAccordion -Content {
        New-ConsoleCollapsible -Key Synopsis -Expanded -Content { 'Gets the services on a computer.' }
        New-ConsoleCollapsible -Key Examples -Summary '(2)' -Content {
            'Get-Service -Name win*'
            'Get-Service | Where-Object Status -eq Running'
        }
    }
}

Fold long sections of a help page and keep one open at a time.

Parameters

-Content Object requiredposition: 0
The sections of the group: New-ConsoleCollapsible output, or a script block that emits it.

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.