PSHostUserInterface Class

Definition

Defines the properties and facilities providing by an hosting application deriving from PSHost that offers dialog-oriented and line-oriented interactive features.

public abstract class PSHostUserInterface
Inheritance
PSHostUserInterface

Constructors

PSHostUserInterface()

added protected ctor per design guidelines

Properties

RawUI

Gets hosting application's implementation of the
PSHostRawUserInterface abstract base class that implements that class.

Methods

Prompt(String, String, Collection<FieldDescription>)

Constructs a 'dialog' where the user is presented with a number of fields for which to supply values.

PromptForChoice(String, String, Collection<ChoiceDescription>, Int32)

Presents a dialog allowing the user to choose an option from a set of options.

PromptForCredential(String, String, String, String)

Prompt for credentials.

PromptForCredential(String, String, String, String, PSCredentialTypes, PSCredentialUIOptions)

Prompt for credential.

ReadLine()

Reads characters from the console until a newline (a carriage return) is encountered.

ReadLineAsSecureString()

Same as ReadLine, except that the result is a SecureString, and that the input is not echoed to the user while it is collected (or is echoed in some obfuscated way, such as showing a dot for each character).

Write(ConsoleColor, ConsoleColor, String)

Same as Write(String), except that colors can be specified.

Write(String)

Writes characters to the screen buffer. Does not append a carriage return.

WriteDebugLine(String)

Invoked by WriteDebug(String) to display a debugging message to the user.

WriteErrorLine(String)

Writes a line to the "error display" of the host, as opposed to the "output display," which is written to by the variants of and

WriteInformation(InformationRecord)
WriteLine()

The default implementation writes a carriage return to the screen buffer.

WriteLine(String)

Writes characters to the screen buffer, and appends a carriage return.

WriteLine(ConsoleColor, ConsoleColor, String)

Same as WriteLine(String), except that colors can be specified.

WriteProgress(Int64, ProgressRecord)

Invoked by System.Management.Automation.Cmdlet.WriteProgress(System.Int64,System.Management.Automation.ProgressRecord) to display a progress record.

WriteVerboseLine(String)

Invoked by WriteVerbose(String) to display a verbose processing message to the user.

WriteWarningLine(String)

Invoked by WriteWarning(String) to display a warning processing message to the user.