I did, and I’ve been trying this, but not quite there:
Import-PfxCertificate -FilePath C:\Temp\certs\xxxxx.pfx -Password (Read-Host -Prompt "Please enter the password") -CertStoreLocation Cert:\LocalMachine\My | out-file -Append -FilePath c:\temp\certs.txt
The error I get is this:
Import-PfxCertificate : Cannot bind parameter 'Password'. Cannot convert the "12345" value of type "System.String" to type "System.Security.SecureString"
I was trying various ways of using ConvertTo-SecureString -String, but I dont have the correct syntax, or its just wrong.
You should always read the help for the cmdlets you’re about to use completely including the examples to löearn how to use them. There is even an example for particular purpose
… and please … your code will be way easier to read and to understand when you use line breaks after each pipe symbol. You should read the following topic as well: