Import one or more certificates into a certificate store.
Syntax
Import-Certificate [-FilePath] String [-CertStoreLocation String]
[-WhatIf] [-Confirm] [CommonParameters]
Key
-CertStoreLocation
The path to the certificate store where the certificates will be imported.
If the path to the certificate store is not specified, then the current store is used.
In order to get a list of valid CertStoreLocation values, open PowerShell and run Get-ChildItem Cert:\.
-Confirm
Prompt for confirmation before running the cmdlet.
-FilePath
The path to a certificate file to be imported. Acceptable formats include .sst, .p7b, and .cert files.
If the file contains multiple certificates, then each certificate will be imported to the destination
store. The file must be in .sst format to import multiple certificates; otherwise, only the first
certificate in the file will be imported.
-WhatIf
Show what would happen if the cmdlet runs. The cmdlet is not run.
Standard Aliases for Import-Certificate: none
The Import-Certificate cmdlet imports one or more certificates into a certificate store.
Import the certificate from the file into the root store of the current user:
$params = @{
FilePath = 'C:\Users\Xyz\Desktop\BackupCert.cer'
CertStoreLocation = 'Cert:\CurrentUser\Root'
}
Import-Certificate @params
Import the certificate from the file into the current store:
PS C:\> Set-Location -Path cert:\CurrentUser\My
PS C:\> Import-Certificate -Filepath 'C:\files\intermediate.cert'
Import the certificate from the file into the root store of the local machine:
PS C:\> $params = @{
FilePath = 'C:\Users\Xyz\Desktop\BackupCert.cer'
CertStoreLocation = 'Cert:\LocalMachine\Root'
}
Import-Certificate @params
âEverybody thinks that when new technologies come along that they're transparent and you can just do your job well on it. But technologies always import a whole new set of values with themâ ~ Brian Eno
Get-Certificate - Submit a certificate request to an enrollment server.
Export-Certificate - Export a certificate from a certificate store into a file.
Equivalent CMD commands: CERTUTIL - Display certification authority, configure Certificate Services. CERTREQ - Request cert.