API Reference
Interface
ILineConsole
Line-based input and output for InteractionMode.Line and InteractionMode.Accessible prompts: the console by default, or a PowerShell host (Host.UI.ReadLine, PromptForChoice) in remoting and the ISE.
Usage
Explore 1 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 1
- Property InteractiveOptions.LineConsole
Methods
public abstract Int32? Choose(String caption, String message, IReadOnlyList<String> choices, Int32 defaultIndex) #Returns:
Int32?Lets the host ask a choice question natively (PowerShell's PromptForChoice). Return null to fall back to a numbered list.
Parameters
- caption System.String
- The question.
- message System.String
- Extra text, or empty.
- choices System.Collections.Generic.IReadOnlyList<System.String>
- The choice labels.
- defaultIndex System.Int32
- The default choice, or -1.
Returns
The chosen index, or null when not supported.
public abstract String? ReadLine() #Returns:
String?Reads a line; null when the input ended.
Returns
The line.
public abstract String? ReadSecret() #Returns:
String?Reads a line without echoing it; null when the input ended.
Returns
The secret.
public abstract Void Write(String text) #Returns:
VoidWrites text without ending the line (the question before an answer).
Parameters
- text System.String
- The text.
public abstract Void WriteLine(String text) #Returns:
VoidWrites a line.
Parameters
- text System.String
- The text.