Exemplo n.º 1
0
        internal static SecureString PromptForSecureString(PSHostUserInterface hostUI, string prompt)
        {
            hostUI.Write(prompt);
            SecureString secureString = hostUI.ReadLineAsSecureString();

            hostUI.WriteLine("");
            return(secureString);
        }
        public override SecureString ReadLineAsSecureString()
        {
            if (externalUI == null)
            {
                throw new InvalidOperationException("Unable to ReadLineAsSecureString from host in headless session");
            }

            return(externalUI.ReadLineAsSecureString());
        }
        public override SecureString ReadLineAsSecureString()
        {
            if (externalUI == null)
            {
                throw new InvalidOperationException();
            }

            return(externalUI.ReadLineAsSecureString());
        }
Exemplo n.º 4
0
        /// <summary>
        /// present a prompt for a SecureString data
        /// </summary>
        ///
        /// <param name="hostUI"> ref to host ui interface </param>
        ///
        /// <param name="prompt"> prompt text </param>
        ///
        /// <returns> user input as secure string </returns>
        ///
        /// <remarks>  </remarks>
        ///
        internal static SecureString PromptForSecureString(PSHostUserInterface hostUI,
                                                           string prompt)
        {
            SecureString ss = null;

            hostUI.Write(prompt);
            ss = hostUI.ReadLineAsSecureString();
            hostUI.WriteLine(string.Empty);

            return(ss);
        }
Exemplo n.º 5
0
 public override SecureString ReadLineAsSecureString()
 {
     return(_ui.ReadLineAsSecureString());
 }