Cmdlet
New-ConsoleBinding
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 SetsDescription
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
- Display builder, invoked initially and after state changes on the parent input thread.
- -Name String
- 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.