保存凭据/密码
$username = "admin"
$password = ConvertTo-SecureString "123" -AsPlainText -Force
$psCred = New-Object System.Management.Automation.PSCredential -ArgumentList ($username, $password)
打印密码
$bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($psCred.Password)
System.Runtime.InteropServices.Marshal]::PtrToStringAuto($bstr)
123