< Back

Get-AzureKeyVaultKey

Tue Jan 29, 2019 9:50 pm

NAME Get-AzureKeyVaultKey



SYNOPSIS

Gets Key Vault keys.





SYNTAX

Get-AzureKeyVaultKey [-VaultName] <String> [-Name] <String> [-DefaultProfile <IAzureContextContainer>] -IncludeVersions [<CommonParameters>]



Get-AzureKeyVaultKey [-InputObject] <PSKeyVault> [-Name] <String> [-DefaultProfile <IAzureContextContainer>] -IncludeVersions [<CommonParameters>]



Get-AzureKeyVaultKey [-InputObject] <PSKeyVault> [[-Name] <String>] [-DefaultProfile <IAzureContextContainer>] [-InRemovedState]

[<CommonParameters>]



Get-AzureKeyVaultKey [-InputObject] <PSKeyVault> [-Name] <String> [-Version] <String> [-DefaultProfile <IAzureContextContainer>]

[<CommonParameters>]



Get-AzureKeyVaultKey [-VaultName] <String> [[-Name] <String>] [-DefaultProfile <IAzureContextContainer>] [-InRemovedState] [<CommonParameters>]



Get-AzureKeyVaultKey [-VaultName] <String> [-Name] <String> [-Version] <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]





DESCRIPTION

The Get-AzureKeyVaultKey cmdlet gets Azure Key Vault keys. This cmdlet gets a specific Microsoft.Azure.Commands.KeyVault.Models.KeyBundle or a

list of all KeyBundle objects in a key vault or by version.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-IncludeVersions [<SwitchParameter>]

Indicates that this cmdlet gets all versions of a key. The current version of a key is the first one on the list. If you specify this

parameter you must also specify the Name and VaultName parameters.



If you do not specify the IncludeVersions parameter, this cmdlet gets the current version of the key with the specified Name .



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-InputObject <PSKeyVault>

KeyVault object.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-InRemovedState [<SwitchParameter>]

Specifies whether to show the previously deleted keys in the output



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies the name of the key bundle to get.



Required? false

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-VaultName <String>

Specifies the name of the key vault from which this cmdlet gets keys. This cmdlet constructs the fully qualified domain name (FQDN) of a key

vault based on the name that this parameter specifies and your selected environment.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Version <String>

Specifies the key version. This cmdlet constructs the FQDN of a key based on the key vault name, your currently selected environment, the key

name, and the key version.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

String







OUTPUTS

List<Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultKeyIdentityItem>, Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultKey,

List<Microsoft.Azure.Commands.KeyVault.Models.PSDeletedKeyVaultKeyIdentityItem>, Microsoft.Azure.Commands.KeyVault.Models.PSDeletedKeyVaultKey







NOTES









Example 1: Get all the keys in a key vault



PS C:\\>Get-AzureKeyVaultKey -VaultName 'Contoso'



This command gets all the keys in the key vault named Contoso.





Example 2: Get the current version of a key



PS C:\\>Get-AzureKeyVaultKey -VaultName 'Contoso' -KeyName 'ITPfx'



This command gets the current version of the key named ITPfx in the key vault named Contoso.





Example 3: Get all versions of a key



PS C:\\>Get-AzureKeyVaultKey -VaultName 'Contoso' -KeyName 'ITPfx' -IncludeVersions



This command gets all versions the key named ITPfx in the key vaultnamed Contoso.





Example 4: Get a specific version of a key



PS C:\\>$Key = Get-AzureKeyVaultKey -VaultName 'Contoso' -KeyName 'ITPfx' -Version '5A12A276385949DB8B5F82AFEE85CAED'



This command gets a specific version of the key named ITPfx in the key vault named Contoso. After running this command, you can inspect various

properties of the key by navigating the $Key object.





Example 5: Get all the keys that have been deleted but not purged for this key vault.



PS C:\\>Get-AzureKeyVaultKey -VaultName 'Contoso' -InRemovedState



This command gets all the keys that have been previously deleted, but not purged, in the key vault named Contoso.





Example 6: Gets the key ITPfx that has been deleted but not purged for this key vault.



PS C:\\>Get-AzureKeyVaultKey -VaultName 'Contoso' -KeyName 'ITPfx' -InRemovedState



This command gets the key ITPfx that has been previously deleted, but not purged, in the key vault named Contoso. This command will return

metadata such as the deletion date, and the scheduled purging date of this deleted key.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... eyvaultkey

Add-AzureKeyVaultKey

Remove-AzureKeyVaultKey

Undo-AzureKeyVaultKeyRemoval

Set-AzureKeyVaultKeyAttribute