Q38 Key Vault Domain 4 · 20–25% of exam

Which PowerShell cmdlet retrieves a secret value from Key Vault as plain text?

  1. A Get-AzKeyVaultSecret -VaultName -Name | Select-Object -ExpandProperty SecretValue | ConvertFrom-SecureString -AsPlainText (correct answer)
  2. B Get-AzKeyVaultSecretValue
  3. C Get-Secret
  4. D az keyvault secret show --query value

Shortcut: Get-AzKeyVaultSecret returns the secret as a PSKeyVaultSecret with SecretValue as a SecureString. Password for plain text.

Get-AzKeyVaultSecret returns the secret as a PSKeyVaultSecret with SecretValue as a SecureString. Convert with ConvertFrom-SecureString -AsPlainText (PowerShell 7+) or NetworkCredential.Password for plain text.