我有以下 Powershell 命令
Set-AzVMExtension -ExtensionName "MicrosoftMonitoringAgent" `
-ResourceGroupName "rg-xxxx" `
-VMName "vm-xxxx" `
-Publisher "Microsoft.EnterpriseCloud.Monitoring" `
-ExtensionType "MicrosoftMonitoringAgent" `
-TypeHandlerVersion "1.0" `
-Settings @{"workspaceId" = "xxxx" } `
-ProtectedSettings @{"workspaceKey" = "xxxx"} `
-Location "uksouth"
它成功地将 VM 上的所有日志分析工作区替换为我在命令中配置的工作区。 我想要做的只是添加工作区而不替换已经配置的工作区。
ARM 具有相同的行为。看起来如果已经有一个工作区,那么它会被覆盖,如果那里有两个工作区,那么其中一个会被覆盖。
有谁知道在 Powershell 中只添加工作区而不覆盖的任何方法? 谢谢, 尼尔。