All versions are supported.
Typically loads a certificate from a file and installs it to the specified library. You can use the following script:
Copy Code code as follows:
$pfxpath = ' C:\temp\test.pfx '
$password = ' Test '
[System.Security.Cryptography.X509Certificates.StoreLocation] $Store = ' CurrentUser '
$StoreName = ' root '
Add-type-assemblyname System.Security
$certificate = New-object System.Security.Cryptography.X509Certificates.X509Certificate2
$certificate. Import ($pfxpath, $password, ' exportable ')
$Store = New-object System.security.cryptography.X509Certificates.x509Store ($StoreName, $StoreLocation)
$Store. Open (' ReadWrite ')
$Store. ADD ($certificate)
$Store. Close ()
Now you can configure this script to specify the location and password of the certificate. You can also specify a storage location (current user or Local computer) and add a certificate (such as a trusted root certificate) or a private certificate.