将字符保存成凭据
$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
Done
确定删除《PowerShell 保存凭据并转换成字符》吗
暂无评论
2023-12-12
2023-12-08
2023-12-07
2023-11-02
2024-05-17