Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Get-AzureKeyVaultKey

Get-AzureKeyVaultKey

microsoft.azure.commands.keyvault.dll

Synopsis

Gets the keys in a vault.

Syntax

Get-AzureKeyVaultKey [-Name] [-Profile] [-IncludeVersions] [<CommonParameters>]

Get-AzureKeyVaultKey [-VaultName] [-Name] [-Version] [-Profile] [<CommonParameters>]

Get-AzureKeyVaultKey [-VaultName] [-Profile] [<CommonParameters>]

Detailed Description

The Get-AzureKeyVaultKey cmdlet gets the keys in an Azure Key Vault. This cmdlet gets a specific Microsoft.Azure.Commands.KeyVault.Models.KeyBundle or a list of all KeyBundle objects in a vault.

Parameters

-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.

Aliases

none

Required?

true

Position

named

Default value

none

Accept pipeline input?

false

Accept wildcard characters?

false

-Name <System.String>

Specifies the name of the key bundle to get.

Aliases

KeyName

Required?

true

Position

2

Default value

none

Accept pipeline input?

true(ByPropertyName)

Accept wildcard characters?

false

-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Aliases

none

Required?

false

Position

named

Default value

none

Accept pipeline input?

false

Accept wildcard characters?

false

-VaultName <String>

Specifies the name of the vault from which this cmdlet gets keys. This cmdlet constructs the fully qualified domain name (FQDN) of a vault based on the name that this parameter specifies and your selected environment.

Aliases

none

Required?

true

Position

1

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 vault name, your currently selected environment, the key name, and the key version.

Aliases

KeyVersion

Required?

false

Position

3

Default value

none

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

Input Type

String

Return Type

List<Microsoft.Azure.Commands.KeyVault.Models.KeyBundle>, Microsoft.Azure.Commands.KeyVault.Models.KeyBundle

Notes

None

Examples

Example 1: Get all the keys in a vault

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

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

Example 2: Get the current version of a key

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

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

Example 3: Get all versions of a key

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

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

Example 4: Get a specific version of a key

This command gets a specific version of the key named ITPfx in the vault named Contoso. After running this command, you can inspect various properties of the key by navigating the $Key object.

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

Online Version
Add-AzureKeyVaultKey
Remove-AzureKeyVaultKey
Set-AzureKeyVaultKeyAttribute