How to build a certificates chain of trust using the `New-SelfSignedCertificate` PowerShell cmdlet?

Step 1

Create a temporary root authority (self-signed) certificate using the New-SelfSignedCertificate cmdlet.
Save the private key to the disk.

learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/working-with-certificates#to-build-a-chain-of-trust-with-the-new-selfsignedcertificate-cmdlet

Details

learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-create-temporary-certificates-for-use-during-development#to-create-a-self-signed-root-authority-certificate-and-export-the-private-key

Step 2

Use the new certificate to issue another certificate that contains the public key.

learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/working-with-certificates#to-build-a-chain-of-trust-with-the-new-selfsignedcertificate-cmdlet

Details

learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-create-temporary-certificates-for-use-during-development#to-create-a-new-certificate-signed-by-a-root-authority-certificate

Step 3

Import the root authority certificate into the Trusted Root Certification Authorities store.

learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/working-with-certificates#to-build-a-chain-of-trust-with-the-new-selfsignedcertificate-cmdlet