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()); }
/// <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); }
public override SecureString ReadLineAsSecureString() { return(_ui.ReadLineAsSecureString()); }