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 ref class PSHostUserInterface abstract
public abstract class PSHostUserInterface
type PSHostUserInterface = class
Public MustInherit Class PSHostUserInterface
Inheritance
PSHostUserInterface

Constructors

PSHostUserInterface()

Creates a new instance of the PSHostUserInterface class.

Properties

RawUI

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

SupportsVirtualTerminal

Returns true for hosts that support VT100 like virtual terminals.

Methods

GetFormatStyleString(PSHostUserInterface+FormatStyle)

Get the ANSI escape sequence for the given format style.

GetOutputString(String, Boolean)

Get the appropriate output string based on different criteria.

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 Write(String)Write(ConsoleColor, ConsoleColor, String)WriteLine() and WriteLine(String)

WriteInformation(InformationRecord)

Invoked by WriteInformation(InformationRecord) to give the host a chance to intercept informational messages. These should not be displayed to the user by default, but may be useful to display in a separate area of the user interface.

WriteLine()

The default implementation writes a carriage return to the screen buffer. Write(String)Write(ConsoleColor, ConsoleColor, String)WriteLine(String)WriteLine(ConsoleColor, ConsoleColor, String)

WriteLine(ConsoleColor, ConsoleColor, String)

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

WriteLine(String)

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

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.

Applies to

See also