支持所有PS版本
當(dāng)你使用Get-PfxCertificate讀取PFX證書去簽名你的腳本,但是它總是會(huì)已交互式方式提示用戶去輸入密碼。
下面介紹怎么通過腳本去提交密碼:
代碼如下:
$PathToPfxFile = 'C:/temp/test.pfx'
$PFXPassword = 'test'
Add-Type -AssemblyName System.Security
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cert.Import($PathToPfxFile, $PFXPassword, 'Exportable')
$cert
|
新聞熱點(diǎn)
疑難解答
圖片精選