gpt4 book ai didi

azure - 如何使用 PowerShell 查找用于创建 Azure VM 的 VM 镜像的名称?

转载 作者:行者123 更新时间:2023-12-03 15:25:26 26 4
gpt4 key购买 nike

如果我使用 Get-AzureVM(PowerShell cmdlet)来获取正在运行的 VM,那么我返回的字段为

DeploymentName
Name
Label
VM
InstanceStatus
IpAddress
InstanceStateDetails
PowerState
InstanceErrorCode
InstanceFaultDomain
InstanceName
InstanceUpgradeDomain
InstanceSize
HostName
AvailabilitySetName
DNSName
Status
GuestAgentStatus
ResourceExtensionStatusList
PublicIPAddress
PublicIPName
PublicIPDomainNameLabel
PublicIPFqdns
NetworkInterfaces
VirtualNetworkName
ServiceName
OperationDescription
OperationId
OperationStatus

但是我看不到用于创建虚拟机的镜像的名称。我可以使用 Azure 门户(在“设置”>“属性”>“源图像名称”下)查看此信息。如何使用 PowerShell 获取源图像名称?

最佳答案

如果您想在不使用 cmd/Powershell 的情况下检查源镜像,请按照以下步骤操作:如何查找正在运行的VM镜像版本。

> Go to azure portal
> Select the running/stopped VM whose image you want to identify
> Go to export template option
> On the right side of the screen, you will see the template window will open in JSON format.
> Ctrl+F (search) > imageReference > you will get your image version in the template.

关于azure - 如何使用 PowerShell 查找用于创建 Azure VM 的 VM 镜像的名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32431186/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com