How to Export PFX file from Chain of certificate and KEY file with OPENSSL

Use below command to extract the PFX file using certificate Chain.

openssl pkcs12 -export -out SSLCertificate.pfx -inkey Certificate.key -in SSLCertificate.crt -in intermediateCA.crt -in rootCA.crt 

openssl pkcs12 -export -out SSLCertificate.pfx -inkey Certificate.key -in SSLCertificate.crt