I have a situation I am writing a powershell GUI.
I need to take the password in a secure input.. How can I do it ?
The passwd input need to be secured in the window
below is my code

$Passwd                         = New-Object system.Windows.Forms.TextBox
$Passwd.multiline               = $false
$Passwd.width                   = 150
$Passwd.height                  = 20
$Passwd.location                = New-Object System.Drawing.Point(169,26)
$Passwd.Font                    = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$Passwd.ForeColor               = [System.Drawing.ColorTranslator]::FromHtml("#7ed321")
$Passwd.BackColor               = [System.Drawing.ColorTranslator]::FromHtml("#000000")

this is the code
the passwd input nee to be secured input ?

Powershell GUI, How to take password input without exposing
You need to set UseSystemPasswordChar to $true:
$Passwd.UseSystemPasswordChar = $true

