Skip to content

Remove-KeyVaultKey

Azure: Removes a Key Vault key

param(
	[Parameter(Mandatory = $true)]
	[string]$VaultName,

	[Parameter(Mandatory = $true)]
	[string]$Name
)

try {
	Import-Module Az.KeyVault -ErrorAction Stop
	Remove-AzKeyVaultKey -VaultName $VaultName -Name $Name -ErrorAction Stop
	Write-Output "Successfully removed key '$Name' from vault '$VaultName'."
} catch {
	Write-Error $_
	exit 1
}

The name of the Key Vault.

The name of the key to remove.

An interactive directory of PowerShell scripts.