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

Get-AzureKeyVaultSecret

microsoft.azure.commands.keyvault.dll

Synopsis

Gets the secrets in a vault.

Syntax

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

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

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

Detailed Description

The Get-AzureKeyVaultSecret cmdlet gets secrets in an Azure Key Vault. This cmdlet gets a specific secret or all the secrets in a vault.

Parameters

-IncludeVersions <SwitchParameter>

Indicates that this cmdlet gets all versions of a secret. The current version of a secret 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 secret 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 secret to get.

Aliases

SecretName

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 to which the secret belongs. This cmdlet constructs the fully qualified domain name (FQDN) of a vault based on the name that this parameter specifies and your current environment.

Aliases

none

Required?

true

Position

1

Default value

none

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Version <String>

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

Aliases

SecretVersion

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.Secret>, Microsoft.Azure.Commands.KeyVault.Models.Secret

Notes

None

Examples

Example 1: Get all current versions of all secrets in a vault

This command gets the current versions of all secrets in the vault named Contoso.

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

Example 2: Get all versions of a specific secret

This command gets all versions of the secret named ITSecret in the vault named Contoso.

PS C:\>Get-AzureKeyVaultSecret -VaultName "Contoso" -Name "ITSecret" -IncludeVersions

Example 3: Get the current version of a specific secret

This command gets the current version of the secret named ITSecret in the vault named Contoso.

PS C:\>Get-AzureKeyVaultSecret -VaultName "Contoso" -Name "ITSecret"

Example 4: Get a specific version of a specific secret

This command gets a specific version of the secret named ITSecret in the vault named Contoso.

PS C:\>Get-AzureKeyVaultSecret -VaultName "Contoso" -Name "ITSecret" –Version "6A12A286385949DB8B5F82AFEF85CAE9"

Online Version
Remove-AzureKeyVaultSecret
Set-AzureKeyVaultSecret