title: How to changing the name of the certificate with the number I got from the textBox
body: <p>I have a powershell command where i generate one certificate and
  I have a web application where I get the certificate name as a string.</p>
  <pre><code>protected void ExecuteCode_Click(object sender, EventArgs e)
      {
          string Test = ResultBox.Text;
          string script = (@&quot;$certificate = New-SelfSignedCertificate `
                                              -Subject NewCertificate `
                                              -DnsName NewCertificate `
                                              -KeyAlgorithm RSA `
                                              -KeyLength 2048 `
                                              -NotBefore (Get-Date) `
                                              -NotAfter (Get-Date).AddYears(2) `
                                              -CertStoreLocation 'Cert:\CurrentUser\My' `
                                              -FriendlyName 'Localhost Certificate for .Net Core' `
                                              -HashAlgorithm SHA256 `
                                              -KeyUsage DigitalSignature, KeyEncipherment, DataEncipherment `
                                               -TextExtension @('2.5.29.37={text}1.3.6.1.5.5.7.3.1')
                                          $certificatePath = 'Cert:\CurrentUser\My\' + ($certificate.ThumbPrint)
                                          
                                          $tmpPath = 'C:\sertifikalar'
                                          If(!(test-path $tmpPath))
                                          {
                                          New-Item -ItemType Directory -Force -Path $tmpPath
                                          } 
  
                                          $pfxPassword = ConvertTo-SecureString -String '1234' -Force -AsPlainText
                                          $pfxFilePath = 'c:\sertifikalar\''{0}''.pfx'
                                          $cerFilePath = 'c:\sertifikalar\''{0}''.cer' 
                                          
                                          Export-PfxCertificate -Cert $certificatePath -FilePath $pfxFilePath -Password $pfxPassword
                                          Export-Certificate -Cert $certificatePath -FilePath $cerFilePath
                                          
                                          Import-PfxCertificate -FilePath $pfxFilePath Cert:\LocalMachine\My -Password $pfxPassword -Exportable
                                          Import-Certificate -FilePath $cerFilePath -CertStoreLocation Cert:\CurrentUser\Root&quot;+ Test);
  </code></pre>
  <p>string Test is .pfx .cer certificate name. But i cant give parameter in my string. Please help me.</p>