Skip to content
ConsoleMonster
Cmdlet

New-ConsoleMultiSelect

Module
ConsoleMonster
Inputs
None
Outputs
ConsoleMonster.Interactive.MultiSelect

Creates a named multiselect input for Show-ConsoleApp.

Syntax

New-ConsoleMultiSelect
-Choices <Object[]>
[-Disabled]
[-Display <Object>]
[[-Label] <String>]
[-Name] <String>
[-OnChange <ScriptBlock>]
[-TabIndex <Int32>]
[-Value <Object[]>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Choices use the shared prompt conversion and retain original objects as values. Keep the input in the stable outer layout. Disabled choices cannot be selected.

Examples

Example 1

New-ConsoleMultiSelect -Name Sites -Choices 'Warsaw', 'Berlin' -Value Warsaw

Choose initial values.

Parameters

-Choices Object[] required
Choices as objects or existing Choice values. Objects themselves become the selected values.
-Disabled SwitchParameter optional
Disables editing and removes the input from keyboard focus traversal.
-Display Object optional
Display property name or scriptblock for object choices, as in Read-ConsoleSelection.
-Label String optionalposition: 1
Visible label; defaults to the name using the core control's labels.
-Name String requiredposition: 0
Unique key in the application's state and final hashtable.
-OnChange ScriptBlock optional
Runs once per committed edit on the owning input thread. Receives param($Value, $State) and injected $Value, $State and $Control. State is a hashtable; add or assign keys to write back. Output is discarded. Retains closure variables.
-TabIndex Int32 optional
Keyboard focus order. Equal values preserve layout declaration order.
-Value Object[] optional
Initial selected values from the supplied choices. Omit to retain the core default selection.

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.