Skip to content
ConsoleMonster
Cmdlet

New-ConsoleOutline

Module
ConsoleMonster
Outputs
ConsoleMonster.Interactive.Outline

Creates an outline for Show-ConsoleApp: a list of headings to jump between, such as settings groups or the sections of a long page.

Syntax

New-ConsoleOutline
[-CurrentIndex <Int32>]
[-Disabled]
[-Item] <Object[]>
[-Key] <String>
[-OnChange <ScriptBlock>]
[-TabIndex <Int32>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

The current entry is marked. Up/Down, Home/End and the wheel move the selection; Enter or a click opens it, which makes it current (the final state holds its title). An entry with a Target leads to that control: opening it focuses the control, scrolling a surrounding scroll view to it, and unfolds it when it is a collapsible section. New-ConsoleBreadcrumb -Outline shows the path to the current entry.

Examples

Example 1

$proxy = New-ConsoleCollapsible -Key Proxy -Content { New-ConsoleTextInput -Key ProxyServer -Label 'Server' }
$dns = New-ConsoleCollapsible -Key Dns -Label 'DNS' -Content { New-ConsoleTextInput -Key DnsServers -Label 'Servers' }
Show-ConsoleApp -Content {
    New-ConsoleSplitter -Ratio 0.3 -First {
        New-ConsoleOutline -Key Sections -Item ([pscustomobject]@{ Title = 'Proxy'; Target = $proxy }), ([pscustomobject]@{ Title = 'DNS'; Target = $dns })
    } -Second { $proxy; $dns }
}

Jump between the sections of a settings page.

Parameters

-CurrentIndex Int32 optional
The index of the entry that starts current; -1 (the default) for none.
-Disabled SwitchParameter optional
Disables the outline and removes it from keyboard focus traversal.
-Item Object[] requiredposition: 1
The entries: titles, or records with Title, Level (1 for the top) and Target (a control to open).
-Key String requiredposition: 0
Unique key in the application's state; the value is the current entry's title.
-OnChange ScriptBlock optional
Runs once each time an entry is opened, on the owning input thread. Receives param($Value, $State) and injected $Value, $State and $Control. Output is discarded.
-TabIndex Int32 optional
Keyboard focus order. Equal values preserve layout declaration order.

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.