Get-AzVMImage
获取 VMImage 的所有版本。
语法
Get-AzVMImage
-Location <String>
[-EdgeZone <String>]
-PublisherName <String>
-Offer <String>
-Skus <String>
[-Top <Int32>]
[-OrderBy <String>]
[-Expand <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzVMImage
-Location <String>
[-EdgeZone <String>]
-PublisherName <String>
-Offer <String>
-Skus <String>
-Version <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Get-AzVMImage cmdlet 获取 VMImage 的所有版本。
示例
示例 1:列出 VM 映像对象
Get-AzVMImage -Location "Central US" -PublisherName "MicrosoftWindowsServer" -Offer "windowsserver" -Skus "2025-datacenter"
Version Location PublisherName HyperVGeneration Architecture ImageDeprecationStatus
------- -------- ------------- ---------------- ------------ ----------------------
26100.2033.241004 centralus MicrosoftWindowsServer
26100.2314.241107 centralus MicrosoftWindowsServer
26100.2605.241207 centralus MicrosoftWindowsServer
26100.2894.250113 centralus MicrosoftWindowsServer
26100.3194.250210 centralus MicrosoftWindowsServer
26100.3476.250306 centralus MicrosoftWindowsServer
26100.3775.250406 centralus MicrosoftWindowsServer
此命令获取与指定值匹配的所有 VMImage 版本。
示例 2:列出具有映像弃用状态的 VM 映像对象
Get-AzVMImage -Location "Central US" -PublisherName "MicrosoftWindowsServer" -Offer "windowsserver" -Skus "2025-datacenter" -Expand properties/imageDeprecationStatus
Version Location PublisherName HyperVGeneration Architecture ImageDeprecationStatus
------- -------- ------------- ---------------- ------------ ----------------------
26100.2033.241004 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
26100.2314.241107 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
26100.2605.241207 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
26100.2894.250113 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
26100.3194.250210 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
26100.3476.250306 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
26100.3775.250406 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
此命令获取与映像弃用状态匹配指定值的所有 VMImage 版本。
示例 3:获取 VMImage 对象
Get-AzVMImage -Location "Central US" -PublisherName "MicrosoftWindowsServer" -Offer "windowsserver" -Skus "2025-datacenter" -Version 26100.2033.241004
Id : /Subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Providers/Microsoft.Compute/Locations/cent
ralus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/windowsserver/Skus/2025-d
atacenter/Versions/26100.2033.241004
Location : centralus
PublisherName : MicrosoftWindowsServer
Offer : windowsserver
Skus : 2025-datacenter
Version : 26100.2033.241004
FilterExpression :
Name : 26100.2033.241004
HyperVGeneration : V1
OSDiskImage : {
"operatingSystem": "Windows"
}
PurchasePlan : null
DataDiskImages : []
ImageDeprecationStatus : {
"imageState": "Active",
"scheduledDeprecationTime": null,
"alternativeOption": null
}
此命令获取与指定值匹配的特定 VMImage 版本。
示例 4:获取 VMImage 对象
Get-AzVMImage -Location "Central US" -PublisherName "MicrosoftWindowsServer" -Offer "windowsserver" -Skus "2025-datacenter" -Version 26100.2* -Expand properties
Version Location PublisherName HyperVGeneration Architecture ImageDeprecationStatus
------- -------- ------------- ---------------- ------------ ----------------------
26100.2033.241004 centralus MicrosoftWindowsServer V1 x64
26100.2314.241107 centralus MicrosoftWindowsServer V1 x64
26100.2605.241207 centralus MicrosoftWindowsServer V1 x64
26100.2894.250113 centralus MicrosoftWindowsServer V1 x64
此命令获取与指定值匹配的所有 VMImage 版本,并筛选版本。
参数
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EdgeZone
设置 EdgeZone 的扩展位置名称。 如果未设置,将从 Azure 主区域查询 VM 映像。 否则,将从指定的扩展位置查询它
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Expand
要应用于作的展开表达式。 可能的值包括:“properties”和“properties/imageDeprecationStatus”
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Location
指定 VMImage 的位置。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Offer
指定 VMImage 产品/服务的类型。 若要获取映像产品/服务,请使用 Get-AzVMImageOffer cmdlet。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-OrderBy
指定返回的结果的顺序。 格式化为 OData 查询。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-PublisherName
指定 VMImage 的发布者。 若要获取映像发布者,请使用 Get-AzVMImagePublisher cmdlet。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Skus
指定 VMImage SKU。 若要获取 SKU,请使用 Get-AzVMImageSku cmdlet。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Top
指定返回的最大虚拟机映像数。
类型: | Nullable<T>[Int32] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Version
指定 VMImage 的版本。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | True |