title: Install certificate in dotnet core docker container
body: <p>Previously our application ran on .net framework and we used powershell to install our certificate into the certificate store by running the following command: </p>
  
  <p><code>RUN powershell -NoProfile -Command \
   $Secure_String_Pwd = ConvertTo-SecureString "ourverysecretpassword" -AsPlainText -Force ; \
   Import-PfxCertificate -FilePath /cert.pfx  -CertStoreLocation Cert:\LocalMachine\Root -Exportable -Password $Secure_String_Pwd</code></p>
  
  <p>but now we have transferred our code to .netcore, the above command wont work in the dockerfile anymore.</p>
  
  <p>Any idea on how to install an existing .pfx certificate via the dockerfile into the docker container?</p>
  
  <p>[EDIT]
  Im trying to run my container on windows, here is the complete dockerfile, maybe its just that i use the wrong image:</p>
  
  <p>This is the entire docker file:</p>
  
  <pre><code>FROM microsoft/dotnet
  
  COPY ./Web /app/
  
  COPY cert.pfx /cert.pfx
  
  RUN powershell -NoProfile -Command \
   $Secure_String_Pwd = ConvertTo-SecureString "againourverysecretpassword" -
  AsPlainText -Force ; \
   Import-PfxCertificate -FilePath /cert.pfx  -CertStoreLocation 
   Cert:\LocalMachine\Root -Exportable -Password $Secure_String_Pwd
  
  WORKDIR /app
  
  EXPOSE 5000 
  ENTRYPOINT ["dotnet", "myhost.dll"]
  </code></pre>
  
  <p>Anyhow it fails on the run powershell command, saying: 
  'powershell' is not recognized as an internal or external command,
  operable program or batch file.</p>