I have a PowerShell script that installs pfx certificate into the LocalMachine certificate store. The function looks like this: function Add-Certificate { param ( [Parameter(Position=1, Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$pfxPath, [Parameter(Position=2, Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$pfxPassword ) Write-Host “Installing certificate” -ForegroundColor Yellow try { $pfxcert = new-object system.security.cryptography.x509certificates.x509certificate2 $pfxcert.Import($pfxPath, $pfxPassword, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]”PersistKeySet”) $store = new-object system.security.cryptography.X509Certificates.X509Store -argumentlist “MY”, LocalMachine $store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]”ReadWrite”); … Read more