Editar

Compartilhar via


Update-AzKeyVaultCertificate

Modifies editable attributes of a certificate.

Syntax

Update-AzKeyVaultCertificate
      [-VaultName] <String>
      [-Name] <String>
      [[-Version] <String>]
      [-Enable <Boolean>]
      [-Tag <Hashtable>]
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzKeyVaultCertificate
      [-InputObject] <PSKeyVaultCertificateIdentityItem>
      [[-Version] <String>]
      [-Enable <Boolean>]
      [-Tag <Hashtable>]
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Update-AzKeyVaultCertificate cmdlet modifies the editable attributes of a certificate.

Examples

Example 1: Modify the tags associated with a certificate

$Tags = @{ "Team" = "Azure" ; "Role" = "Engg" }
Update-AzKeyVaultCertificate -VaultName "ContosoKV01" -Name "TestCert01" -Tag $Tags -PassThru

Name        : TestCert01
Certificate : [Subject]
                CN=AZURE

              [Issuer]
                CN=AZURE

              [Serial Number]
                XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

              [Not Before]
                7/27/2016 6:50:01 PM

              [Not After]
                7/27/2018 7:00:01 PM

              [Thumbprint]
                XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Id          : https://ContosoKV01.vault.azure.net:443/certificates/TestCert01
KeyId       : https://ContosoKV01.vault.azure.net:443/keys/TestCert01
SecretId    : https://ContosoKV01.vault.azure.net:443/secrets/TestCert01
Thumbprint  : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Tags        : {[Role, Engg], [Team, Azure]}
Enabled     : True
Created     : 7/28/2016 2:00:01 AM
Updated     : 8/1/2016 5:37:48 PM

The first command assigns an array of key/value pairs to the $Tags variable. The second command sets the tags value of the certificate named TestCert01 to be $Tags.

Example 2

Modifies editable attributes of a certificate. (autogenerated)

Update-AzKeyVaultCertificate -Enable $true -Name 'TestCert01' -VaultName 'ContosoKV01'

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Enable

If present, enable a certificate if value is true. Disable a certificate if value is false. If not specified, the existing value of the certificate's enabled/disabled state remains unchanged.

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Certificate object

Type:PSKeyVaultCertificateIdentityItem
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Certificate name. Cmdlet constructs the FQDN of a secret from vault name, currently selected environment and secret name.

Type:String
Aliases:CertificateName
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PassThru

Cmdlet does not return object by default. If this switch is specified, return certificate object.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Tag

A hashtable representing certificate tags. If not specified, the existing tags of the sertificate remain unchanged. Remove a tag by specifying an empty Hashtable.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VaultName

Vault name. Cmdlet constructs the FQDN of a vault based on the name and currently selected environment.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Version

Certificate version. Cmdlet constructs the FQDN of a certificate from vault name, currently selected environment, certificate name and certificate version.

Type:String
Aliases:CertificateVersion
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSKeyVaultCertificateIdentityItem

Outputs

PSKeyVaultCertificate