Cmdlet
New-ConsoleTextArea
Creates a named multiline text input for Show-ConsoleApp.
Syntax
New-ConsoleTextArea
[-Disabled]
[-Height <Int32>]
[[-Label] <String>]
[-MaxLength <Int32>]
[-Name] <String>
[-OnChange <ScriptBlock>]
[-Placeholder <String>]
[-TabIndex <Int32>]
[-Value <String>]
[<CommonParameters>]#Parameter set:
All Parameter SetsDescription
Emits a stable core TextArea widget. Place inputs in the outer layout, outside dependent bindings. The final state contains the input's committed value.
Examples
Example 1
New-ConsoleTextArea -Name Notes -Height 4 -Value 'Draft'Create an application input.
Parameters
- -Disabled SwitchParameter
- Disables editing and removes the input from keyboard focus traversal.
- -Height Int32
- Number of visible text rows; defaults to six.
- -Label String
- Visible label; defaults to the name using the core control's labels.
- -MaxLength Int32
- Maximum text length in UTF-16 units.
- -Name String
- Unique key in the application's state and final hashtable.
- -OnChange ScriptBlock
- 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.
- -Placeholder String
- Muted hint while the value is empty.
- -TabIndex Int32
- Keyboard focus order. Equal values preserve layout declaration order.
- -Value String
- Initial multiline text; empty by default.
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.