junjie 通过本文主要向大家介绍了powershell脚本,powershell执行脚本,powershell 运行脚本,powershell常用脚本,powershell脚本下载等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
支持所有PS版本
当你使用Get-PfxCertificate读取PFX证书去签名你的脚本,但是它总是会已交互式方式提示用户去输入密码。
下面介绍怎么通过脚本去提交密码:
$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
</div>

