In this article, you’re going to learn how to create a self-signed certificate in PowerShell.

This cmdlet is included in the

module.

There are many options when it comes to creating certificates.

iPhone 16e with iPhone 16 Plus and iPhone 16 Pro in hand against grey wall.

Common self-signed certificate types are

(default for the cmdlet) and

.

Let’s go ahead and create a regular

certificate.

This is one that usually is used to protect websites with SSL encryption.

An Excel table with a named range.

you might see an example of this below.

In this example, the certificate is being stored in the

.

If all went well, you should now have a newly-created certificate!

Article image

This is because the second URL becomes part of the subject alternate list.

*

Finding Information on our Certificate

Let’s double-check the certificate was created the way we expected.

In addition, theNotAfterdate is correctly populated to be 6 months from the date of creation.

Code Signing Certificate

If you work in PowerShell, you will know aboutexecution policies.

To create a certificate to do this, it’s pretty simple!

Using theNew-SelfSignedCertificatecmdlet, we can easily make a certificate to encrypt your documents.

Summary

PowerShell makes creating self-signed certificates incredibly easy to do.

You won’t have a valid certificate trust chain to validate your self-signed certificates.