PowerCLI Reference

Export-Tpm2CACertificate

Synopsis

This cmdlet exports the CA certificate from either the certificate in the specified TPM 2.0 endorsement key or the specified certificate to a file.

Syntax

Export-Tpm2CACertificate [-Certificate] <X509Certificate2> [-FilePath] <String> [-Force] [-RunAsync] [<CommonParameters>]

Export-Tpm2CACertificate [-Tpm2EndorsementKey] <Tpm2EndorsementKey> [-FilePath] <String> [-Force] [-RunAsync] [<CommonParameters>]

Related Commands

Online Version
Get-Tpm2EndorsementKey

Detailed Description

This cmdlet exports the CA certificate from either the certificate in the specified TPM 2.0 endorsement key or the specified certificate to a file.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
CertificateX509Certificate2Specifies the certificate from which you can export the CA certificate to a file.trueFalse
Tpm2EndorsementKeyTpm2EndorsementKeySpecifies the TPM 2.0 endorsement key that you can use to retrieve the CA certificate.trueTrue (ByValue)
FilePathStringSpecifies the path to the file where you want to export the CA certificate.trueFalse
ForceSwitchParameterIndicates that the cmdlet overwrites the existing destination files and creates directories to complete the specified file path.falseFalse
RunAsyncSwitchParameterIndicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter, run "help About_RunAsync" in the VMware PowerCLI console.falseFalse

Return Type

System.IO.FileInfo

Notes

This cmdlet does not work well on macOS. For more information, see https://github.com/dotnet/corefx/issues/41775#issuecomment-542035240.

Examples

-------------------------- Example 1 --------------------------

$tpm2Ek = Get-Tpm2Endorsementkey -VMHost myHost
Export-Tpm2CACertificate -Tpm2EndorsementKey $tpm2Ek -FilePath c:\myfile.zip

Exports the CA certificate from the certificate in the $tpm2EK TPM 2.0 endorsement key that you can retrieve from the myHost host to the c:\myfile.zip file.

-------------------------- Example 2 --------------------------

$tpm2Ek = Get-Tpm2Endorsementkey -VMHost myHost
Export-Tpm2CACertificate -Certificate $tpm2Ek.Certificate -FilePath c:\myfile.zip

Exports the CA certificate from the specified $tpm2EK.Certificate certificate to the c:\myfile.zip file.


Copyright © VMware, Inc. All rights reserved.