Assume I have a custom PowerShell Cmdlet that exports data and encrypts it using a password.
[Cmdlet(VerbsData.Export, \"SampleData\")] public class ExportSample
If you only want to obtain the password, you can use
Read-Host cmdlet with the–asSecureString parameter.
Read-Host
–asSecureString
This parameter mask the input.