Azure 虚拟机规模集 - 检查是否通过 Powershell 停止或启动

Azure Virtual Machine Scale set - Check if stopped or started via Powershell

Azure 有许多 Powershell cmdlet 可用于虚拟机规模集,例如 Get-AzureRmVmss。但是,我还没有找到任何可以让我确定虚拟机规模集是停止还是启动的东西。有谁知道这在 Powershell 中是可能的?我怀疑它必须是,但我找不到支持。

使用下面的 PowerShell Cmdlet 获取虚拟机规模集 (VMSS) 中虚拟机的状态

(Get-AzureRmVmssVM -ResourceGroupName {ResourceGroup-Name} -VMScaleSetName {VMSS-Name} -InstanceView -InstanceId "{Instance-ID}").Statuses
Example:  (Get-AzureRmVmssVM -ResourceGroupName vmss-rg -VMScaleSetName myvmss -InstanceView -InstanceId "1").Statuses