You can use Read-Host to hide user inputs for safe password prompts:
$pwd = Read-Host -AsSecureString 'Enter Password'
Enter Password: ******
Enter Password: ******
$pwd
System.Security.SecureString
System.Security.SecureString
However, the result in this case is an encrypted secure string. To un-encrypt it to plain text, you can easily convert the password into a credential object and use its GetNetworkCredential() method:
(New-Object System.Management.Automation.PSCredential('dummy',$pwd)).GetNetworkCredential().Password
secret
secret