我正在尝试为已部署的服务获取Azure实例,然后检查所有实例状态是否都在"正在运行".如何使用Windows Azure Powershell cmdlet完成此操作?
这是您要查找的命令:
$NonReadyInstances = (Get-AzureDeployment mikewoazuredemo -Slot Production).RoleInstanceList | Where-Object { $_.InstanceStatus -ne "ReadyRole" } | ft -Property RoleName, InstanceName, InstanceStatus $NonReadyInstances
这将为您提供任何未处于就绪状态的角色中的任何实例的列表.如果你想要那些准备就绪的东西,那么在Where-Object中将-ne更改为-e.可以在REST API文档中找到实例的状态,以获取此cmdlet在此范围内调用的Get Deployment操作.