How does one securely handle passwords in a custom written PowerShell cmdlet?

后端 未结 5 713
没有蜡笔的小新
没有蜡笔的小新 2021-01-22 16:43

Assume I have a custom PowerShell Cmdlet that exports data and encrypts it using a password.

[Cmdlet(VerbsData.Export, \"SampleData\")]
public class ExportSample         


        
5条回答
  •  不思量自难忘°
    2021-01-22 17:03

    If you only want to obtain the password, you can use

    Read-Host cmdlet with the–asSecureString parameter.

    This parameter mask the input.

提交回复
热议问题