Backup-KeyVaultCertificate
Azure: Backs up a Key Vault certificate
param(
[Parameter(Mandatory = $true)]
[string]$VaultName,
[Parameter(Mandatory = $true)]
[string]$Name,
[Parameter(Mandatory = $true)]
[string]$OutputFile
)
try {
Import-Module Az.KeyVault -ErrorAction Stop
Backup-AzKeyVaultCertificate -VaultName $VaultName -Name $Name -OutputFile $OutputFile -ErrorAction Stop
Write-Output "Successfully backed up certificate '$Name' to '$OutputFile'."
} catch {
Write-Error $_
exit 1
}The name of the Key Vault.
The name of the certificate to back up.
The path to save the backup file.