Automatically sign powershell script using Get-PfxCertificate

Question:

I have to sign remote scripts with a certificate from the remote machine from which I have a .pfx file.

I would like to automate the scripting by supplying the password to the Get-PfxCertificate programmatically.

So the question is:

Is it possible to somehow supply programmatically the required password to

Get-PfxCertificate?

Answer:


Make sure you have the proper permissions otherwise you won’t be able to create an instance of the X509Certificate2 object.

Source:

Automatically sign powershell script using Get-PfxCertificate by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply