PSHostUserInterface.ReadLineAsSecureString Method

When overridden in a derived class, reads characters entered by the user until a newline (carriage return) character is encountered and returns the characters as a secure string.


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

'Usage
Dim instance As PSHostUserInterface
Dim returnValue As SecureString

returnValue = instance.ReadLineAsSecureString

'Declaration
Public MustOverride Function ReadLineAsSecureString As SecureString
public abstract SecureString ReadLineAsSecureString ()
public abstract function ReadLineAsSecureString () : SecureString

Return Value

A SecureString object that contains the characters that are entered by the user.

Exception typeCondition
HostException

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

NotImplementedException

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

RuntimeException

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

This method is similar to the ReadLine method with the exception that the characters are returned as a SecureString object and that they are not echoed to the user as plain text (or in a secure way, such as showing a dot for each character) while the characters are collected.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

 

Target Platforms


Show:
© 2014 Microsoft