列出 azure VM 的特定 VM 详细信息

List specific VM details of azure VM

我需要为我的订阅 ID 下的所有 azure 虚拟机列出 Name, IpAddress, ServiceName and InstanceStatus。有什么办法可以将所有这些详细信息保存到某个文本文件中或在屏幕上显示吗?

是的。如果你的机器上安装了 Azure powershell,这很容易。 运行 如果您想在显示器上查看结果,请执行此命令-

Get-AzureVM | Format-List Name, IpAddress, ServiceName, InstanceStatus

如果您想将此详细信息保存在文本文件中,请使用此-

Get-AzureVM | Format-List Name, IpAddress, ServiceName, InstanceStatus > c:\Myfolder\VMDetails.txt

希望这能回答您的问题