| external help file | AzureKeyVaultHelper-help.xml |
|---|---|
| Module Name | AzureKeyVaultHelper |
| online version | https://docs.microsoft.com/en-us/powershell/module/az.keyvault/get-azkeyvaultsecret |
| schema | 2.0.0 |
Gets the secrets in a key vault.
Get-AzKeyVaultSecret [[-VaultName] <String>] [[-Name] <String>] [-InRemovedState]
[-DefaultProfile <IAzureContextContainer>] [-Auto] [-Expand] [<CommonParameters>]
Get-AzKeyVaultSecret [[-VaultName] <String>] [-Name] <String> [-IncludeVersions]
[-DefaultProfile <IAzureContextContainer>] [-Auto] [-Expand] [<CommonParameters>]
Get-AzKeyVaultSecret [[-VaultName] <String>] [-Name] <String> [-Version] <String>
[-DefaultProfile <IAzureContextContainer>] [-Auto] [-Expand] [<CommonParameters>]
Get-AzKeyVaultSecret [-InputObject] <PSKeyVault> [-Name] <String> [-IncludeVersions]
[-DefaultProfile <IAzureContextContainer>] [-Auto] [-Expand] [<CommonParameters>]
Get-AzKeyVaultSecret [-InputObject] <PSKeyVault> [-Name] <String> [-Version] <String>
[-DefaultProfile <IAzureContextContainer>] [-Auto] [-Expand] [<CommonParameters>]
Get-AzKeyVaultSecret [-InputObject] <PSKeyVault> [[-Name] <String>] [-InRemovedState]
[-DefaultProfile <IAzureContextContainer>] [-Auto] [-Expand] [<CommonParameters>]
Get-AzKeyVaultSecret [-ResourceId] <String> [-Name] <String> [-IncludeVersions]
[-DefaultProfile <IAzureContextContainer>] [-Auto] [-Expand] [<CommonParameters>]
Get-AzKeyVaultSecret [-ResourceId] <String> [-Name] <String> [-Version] <String>
[-DefaultProfile <IAzureContextContainer>] [-Auto] [-Expand] [<CommonParameters>]
Get-AzKeyVaultSecret [-ResourceId] <String> [[-Name] <String>] [-InRemovedState]
[-DefaultProfile <IAzureContextContainer>] [-Auto] [-Expand] [<CommonParameters>]
The Get-AzKeyVaultSecret cmdlet gets secrets in a key vault. This cmdlet gets a specific secret or all the secrets in a key vault.
Get-AzKeyVaultSecret -Auto -Name 'Secret'
PS C:\> Get-AzKeyVaultSecret -VaultName 'Contoso'
Vault Name : contoso
Name : secret1
Version :
Id : https://contoso.vault.azure.net:443/secrets/secret1
Enabled : True
Expires : 4/6/2018 3:59:43 PM
Not Before :
Created : 4/5/2018 11:46:28 PM
Updated : 4/6/2018 11:30:17 PM
Content Type :
Tags :
Vault Name : contoso
Name : secret2
Version :
Id : https://contoso.vault.azure.net:443/secrets/secret2
Enabled : True
Expires :
Not Before :
Created : 4/11/2018 11:45:06 PM
Updated : 4/11/2018 11:45:06 PM
Content Type :
Tags :
This command gets the current versions of all secrets in the key vault named Contoso.
PS C:\> Get-AzKeyVaultSecret -VaultName 'Contoso' -Name 'secret1' -IncludeVersions
Vault Name : contoso
Name : secret1
Version : 7128133570f84a71b48d7d0550deb74c
Id : https://contoso.vault.azure.net:443/secrets/secret1/7128133570f84a71b48d7d0550deb74c
Enabled : True
Expires : 4/6/2018 3:59:43 PM
Not Before :
Created : 4/5/2018 11:46:28 PM
Updated : 4/6/2018 11:30:17 PM
Content Type :
Tags :
Vault Name : contoso
Name : secret1
Version : 5d1a74ba2c454439886fb8509b6cab3c
Id : https://contoso.vault.azure.net:443/secrets/secret1/5d1a74ba2c454439886fb8509b6cab3c
Enabled : True
Expires :
Not Before :
Created : 4/5/2018 11:44:50 PM
Updated : 4/5/2018 11:44:50 PM
Content Type :
Tags :
This command gets all versions of the secret named secret1 in the key vault named Contoso.
PS C:\> Get-AzKeyVaultSecret -VaultName 'Contoso' -Name 'secret1'
Vault Name : contoso
Name : secret1
Version : 7128133570f84a71b48d7d0550deb74c
Id : https://contoso.vault.azure.net:443/secrets/secret1/7128133570f84a71b48d7d0550deb74c
Enabled : True
Expires : 4/6/2018 3:59:43 PM
Not Before :
Created : 4/5/2018 11:46:28 PM
Updated : 4/6/2018 11:30:17 PM
Content Type :
Tags :
This command gets the current version of the secret named secret1 in the key vault named Contoso.
PS C:\> Get-AzKeyVaultSecret -VaultName 'Contoso' -Name 'secret1' -Version '5d1a74ba2c454439886fb8509b6cab3c'
Vault Name : contoso
Name : secret1
Version : 5d1a74ba2c454439886fb8509b6cab3c
Id : https://contoso.vault.azure.net:443/secrets/secret1/5d1a74ba2c454439886fb8509b6cab3c
Enabled : True
Expires :
Not Before :
Created : 4/5/2018 11:44:50 PM
Updated : 4/5/2018 11:44:50 PM
Content Type :
Tags :
This command gets a specific version of the secret named secret1 in the key vault named Contoso.
PS C:\> $secretText = Get-AzKeyVaultSecret -VaultName 'Contoso' -Name 'ITSecret' -AsPlainText
The cmdlet returns the secret as a string when `-AsPlainText` is applied.
PS C:\> Get-AzKeyVaultSecret -VaultName 'Contoso' -InRemovedState
Vault Name : contoso
Name : secret1
Id : https://contoso.vault.azure.net:443/secrets/secret1
Deleted Date : 4/4/2018 8:51:58 PM
Scheduled Purge Date : 7/3/2018 8:51:58 PM
Enabled : True
Expires :
Not Before :
Created : 4/4/2018 8:51:03 PM
Updated : 4/4/2018 8:51:03 PM
Content Type :
Tags :
Vault Name : contoso
Name : secret2
Id : https://contoso.vault.azure.net:443/secrets/secret2
Deleted Date : 5/7/2018 7:56:34 PM
Scheduled Purge Date : 8/5/2018 7:56:34 PM
Enabled : True
Expires :
Not Before :
Created : 4/6/2018 8:39:15 PM
Updated : 4/6/2018 10:11:24 PM
Content Type :
Tags :
This command gets all the secrets that have been previously deleted, but not purged, in the key vault named Contoso.
PS C:\> Get-AzKeyVaultSecret -VaultName 'Contoso' -Name 'secret1' -InRemovedState
Vault Name : contoso
Name : secret1
Version : 689d23346e9c42a2a64f4e3d75094dcc
Id : https://contoso.vault.azure.net:443/secrets/secret1/689d23346e9c42a2a64f4e3d75094dcc
Deleted Date : 4/4/2018 8:51:58 PM
Scheduled Purge Date : 7/3/2018 8:51:58 PM
Enabled : True
Expires :
Not Before :
Created : 4/4/2018 8:51:03 PM
Updated : 4/4/2018 8:51:03 PM
Content Type :
Tags :
This command gets the secret 'secret1' 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 secret.
PS C:\> Get-AzKeyVaultSecret -VaultName 'Contoso' -Name "secret*"
Vault Name : contoso
Name : secret1
Version :
Id : https://contoso.vault.azure.net:443/secrets/secret1
Enabled : True
Expires : 4/6/2018 3:59:43 PM
Not Before :
Created : 4/5/2018 11:46:28 PM
Updated : 4/6/2018 11:30:17 PM
Content Type :
Tags :
Vault Name : contoso
Name : secret2
Version :
Id : https://contoso.vault.azure.net:443/secrets/secret2
Enabled : True
Expires :
Not Before :
Created : 4/11/2018 11:45:06 PM
Updated : 4/11/2018 11:45:06 PM
Content Type :
Tags :
This command gets the current versions of all secrets in the key vault named Contoso that start with "secret".
Specifies the name of the key vault to which the secret belongs. This cmdlet constructs the fully qualified domain name (FQDN) of a key vault based on the name that this parameter specifies and your current environment.
Type: String
Parameter Sets: ByVaultName, BySecretVersions, BySecretName
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseKeyVault Object.
Type: PSKeyVault
Parameter Sets: ByInputObjectSecretVersions, ByInputObjectSecretName, ByInputObjectVaultName
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseKeyVault Resource Id.
Type: String
Parameter Sets: ByResourceIdSecretVersions, ByResourceIdSecretName, ByResourceIdVaultName
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseSpecifies the name of the secret to get.
Type: String
Parameter Sets: ByVaultName, ByInputObjectVaultName, ByResourceIdVaultName
Aliases: SecretName
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseType: String
Parameter Sets: BySecretVersions, BySecretName, ByInputObjectSecretVersions, ByInputObjectSecretName, ByResourceIdSecretVersions, ByResourceIdSecretName
Aliases: SecretName
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the secret version. This cmdlet constructs the FQDN of a secret based on the key vault name, your currently selected environment, the secret name, and the secret version.
Type: String
Parameter Sets: BySecretName, ByInputObjectSecretName, ByResourceIdSecretName
Aliases: SecretVersion
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIndicates 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 .
Type: SwitchParameter
Parameter Sets: BySecretVersions, ByInputObjectSecretVersions, ByResourceIdSecretVersions
Aliases:
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether to show the previously deleted secrets in the output
Type: SwitchParameter
Parameter Sets: ByVaultName, ByInputObjectVaultName, ByResourceIdVaultName
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe credentials, account, tenant, and subscription used for communication with azure
Type: IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseWill retrieve the secret and return the same type of object that was set.
Type: SwitchParameter
Parameter Sets: ByVaultName, ByInputObjectVaultName, ByResourceIdVaultName
Aliases:
Required: False
Position: 2
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseType: SwitchParameter
Parameter Sets: BySecretVersions, BySecretName, ByInputObjectSecretVersions, ByInputObjectSecretName, ByResourceIdSecretVersions, ByResourceIdSecretName
Aliases:
Required: True
Position: 2
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseWill return just the retrieved secret.
Type: SwitchParameter
Parameter Sets: ByVaultName, ByInputObjectVaultName, ByResourceIdVaultName
Aliases:
Required: False
Position: 2
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseType: SwitchParameter
Parameter Sets: BySecretVersions, BySecretName, ByInputObjectSecretVersions, ByInputObjectSecretName, ByResourceIdSecretVersions, ByResourceIdSecretName
Aliases:
Required: True
Position: 2
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
General notes