Import Certificate to Trusted Root but not to Personal [Command Line]

前端 未结 5 1956
时光说笑
时光说笑 2021-01-31 17:14

I am trying to import two certificates to my local machine using the command line.

I have one certificate to add to the Personal Store of the local machine, and another

5条回答
  •  有刺的猬
    2021-01-31 18:01

    There is a fairly simple answer with powershell.

    Import-PfxCertificate -Password $secure_pw  -CertStoreLocation Cert:\LocalMachine\Root -FilePath certs.pfx
    

    The trick is making a "secure" password...

    $plaintext_pw = 'PASSWORD';
    $secure_pw = ConvertTo-SecureString $plaintext_pw -AsPlainText -Force; 
    Import-PfxCertificate -Password $secure_pw  -CertStoreLocation Cert:\LocalMachine\Root -FilePath certs.pfx;
    

提交回复
热议问题