📌  相关文章
📜  powershell 将 keyvault 的内容复制到另一个 keyvault - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:34.988000             🧑  作者: Mango

代码示例1
Param(
    [Parameter(Mandatory)]
    [string]$sourceVaultName,
    [Parameter(Mandatory)]
    [string]$destVaultName
)

Connect-AzAccount

$secretNames = (Get-AzKeyVaultSecret -VaultName $sourceVaultName).Name
$secretNames.foreach{
    Set-AzKeyVaultSecret -VaultName $destVaultName -Name $_ `
        -SecretValue (Get-AzKeyVaultSecret -VaultName $sourceVaultName -Name $_).SecretValue
}