Skip to content
ConsoleMonster
Cmdlet

New-ConsoleBinding

Module
ConsoleMonster
Inputs
None
Outputs
ConsoleMonster.Interactive.AppBinding

Creates a display rebuilt from application state on the owning PowerShell input thread.

Syntax

New-ConsoleBinding
[-Content] <ScriptBlock>
[-Name <String>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Content receives param($State) and injected $State as a native hashtable. Emit widgets or text using the ordinary layout commands. Input controls must remain in the stable outer layout. Added or assigned state keys write back through AppState; bindings should normally only read state.

Examples

Example 1

Show-ConsoleApp { New-ConsoleTextInput -Name Query; New-ConsoleBinding { "Query: $($State.Query)" } }

Display the current input.

Parameters

-Content ScriptBlock requiredposition: 0
Display builder, invoked initially and after state changes on the parent input thread.
-Name String optional
Optional stable name for the dependent display region.

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.