I have a powershell script that would like user to enter password. It calls a function to get a pop up box for the user input. Now it is in plaintext. I'd like it to be hidden/masked
This is the function created :---
function Read-InputBoxDialog([string]$Message, [string]$WindowTitle, [string]$DefaultText)
{
Add-Type -AssemblyName Microsoft.VisualBasic
return [Microsoft.VisualBasic.Interaction]::InputBox($Message, $WindowTitle, $DefaultText)
}
This is the way i called the function from powershell : ---
$SQLPassword = Read-InputBoxDialog -Message "Please enter SQL password used to connect to Database Server" -WindowTitle "Sql Server Authentication" -DefaultText ""
How do I ask mask the password as **** ?