The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PSHostUserInterface.ReadLine Method ()


Updated: April 27, 2016

Applies To: Windows PowerShell

When overridden in a derived class, reads characters that are entered by the user until a newline (carriage return) character is encountered.

Namespace:   System.Management.Automation.Host
Assembly:  System.Management.Automation (in System.Management.Automation.dll)

Public MustOverride Function ReadLine As String

Return Value

Type: System.String

The characters that are entered by the user.

Exception Condition

The host can throw this exception when it cannot complete an operation.


If this method is not implemented, the host should throw a "not implemented" exception when it receives this call.


The host can throw this exception when an error occurs while a command is running.

For more information about how to read characters and return them as secure strings, see the ReadLineAsSecureString class.

Return to top

Community Additions