Skip to content

Undo-KeyVaultCertificateRemoval

Azure: Undoes a Key Vault certificate removal

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

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

try {
	Import-Module Az.KeyVault -ErrorAction Stop
	$cert = Undo-AzKeyVaultCertificateRemoval -VaultName $VaultName -Name $Name -ErrorAction Stop
	Write-Output "Successfully recovered certificate '$Name' in vault '$VaultName'."
} catch {
	Write-Error $_
	exit 1
}

The name of the Key Vault.

The name of the certificate to recover.

An interactive directory of PowerShell scripts.