如何使用 PowerShell 获取 Azure 可用性集的故障域数量?
powershellsoftware & codingmicrosoft technologies更新于 2026/2/12 13:37:17
Azure 可用性集中的故障域描述了可用性集中共享电源、存储、网络交换机等资源的虚拟机。如果故障域发生故障,则故障域中的所有资源都将不可用。
运行该命令之前,请确保您已连接到 Azure 云(如果没有,请使用 ConnectAzAccount)并拥有正确的 Azure 订阅(使用 Set-AzContext 设置 Azure 订阅)。
$availablityset = Get-AzAvailabilitySet -ResourceGroupName ResourceGroupName -Name AvailabilitySetName
获取故障域数量
$availablityset.PlatformFaultDomainCount
输出
![]()

