using -confirm parameter when -importcertificate RRS feed

  • Question

  • Good evening all,

    i am using the import-certificate command in powershell but get an additional prompt asking me if i am sure i want to add the certificate.

    unfortunately the application i need it for seems to put the certs in the trusted user store by design which creates this prompt.

    i am following this article - https://docs.microsoft.com/en-us/powershell/module/pkiclient/import-certificate?view=win10-ps

    i can see a -confirm switch, can anyone advise where i add this to the below script and what parameter to use to suppress any prompts?

    $file = ( Get-ChildItem -Path C:\Certs\Test.cer )

    $file | Import-Certificate -CertStoreLocation cert:\CurrentUser\Root

    Thank you!

    Tuesday, June 12, 2018 5:40 PM

All replies