$rootCertPath = Join-Path -Path 'cert:\CurrentUser\My\' -ChildPath '$($rootcert.Thumbprint)' $rootcertPassword = ConvertTo-SecureString -String 'some_password' -Force -AsPlainText $rootCert = New-SelfSignedCertificate -DnsName 'some_name' -Type CodeSigningCert -CertStoreLocation 'certs\'