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. However Using saved credentials securely in PowerShell scripts | Kloud Blog is a highly recommended read as it covers how these work and gives some good solutions.