Security with PowerShell

If you need to get passwords from users and then use these in your PowerShell scripts then you need to look at ConvertTo-SecureString which uses a SecureString Class (System.Security). The examples in both of these are well worth studying.