Update-AzGalleryImageVersion
语法
DefaultParameter (默认值)
Update-AzGalleryImageVersion
[-ResourceGroupName] <String>
[-GalleryName] <String>
[-GalleryImageDefinitionName] <String>
[-Name] <String>
[-AsJob]
[-PublishingProfileEndOfLifeDate <DateTime>]
[-PublishingProfileExcludeFromLatest]
[-ReplicaCount <Int32>]
[-Tag <Hashtable>]
[-TargetRegion <Hashtable[]>]
[-TargetExtendedLocation <Hashtable[]>]
[-AllowDeletionOfReplicatedLocation <Boolean>]
[-BlockDeletionBeforeEndOfLife <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ResourceIdParameter
Update-AzGalleryImageVersion
[-ResourceId] <String>
[-AsJob]
[-PublishingProfileEndOfLifeDate <DateTime>]
[-PublishingProfileExcludeFromLatest]
[-ReplicaCount <Int32>]
[-Tag <Hashtable>]
[-TargetRegion <Hashtable[]>]
[-TargetExtendedLocation <Hashtable[]>]
[-AllowDeletionOfReplicatedLocation <Boolean>]
[-BlockDeletionBeforeEndOfLife <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ObjectParameter
Update-AzGalleryImageVersion
[-InputObject] <PSGalleryImageVersion>
[-AsJob]
[-PublishingProfileEndOfLifeDate <DateTime>]
[-PublishingProfileExcludeFromLatest]
[-ReplicaCount <Int32>]
[-Tag <Hashtable>]
[-TargetRegion <Hashtable[]>]
[-TargetExtendedLocation <Hashtable[]>]
[-AllowDeletionOfReplicatedLocation <Boolean>]
[-BlockDeletionBeforeEndOfLife <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
示例
示例 1:更改复制区域和副本计数
$rgName = "myResourceGroup"
$galleryName = "myGallery"
$imageName = "myImage"
$versionName = "1.0.0"
$region1 = @{Name='West US';ReplicaCount=1}
$region2 = @{Name='East US';ReplicaCount=2}
$region3 = @{Name='Central US'}
$targetRegions = @($region1,$region2,$region3)
Update-AzGalleryImageVersion -ResourceGroupName $rgname -GalleryName $galleryName -GalleryImageDefinitionName $imageName -Name $versionName -ReplicaCount 2 -TargetRegion $targetRegions
更新库映像版本的区域。
示例 2:更改映像版本是否应考虑为最新版本。
$rgName = "myResourceGroup"
$galleryName = "myGallery"
$imageName = "myImage"
$versionName = "1.0.0"
Update-AzGalleryImageVersion -ResourceGroupName $rgname -GalleryName $galleryName -GalleryImageDefinitionName $imageName -Name $versionName -PublishingProfileExcludeFromLatest:$false
从最新状态更新库映像版本的排除。 若要在考虑最新版本时包括映像版本,请使用 -PublishingProfileExcludeFromLatest:$false。 若要从最新考虑中排除映像版本,请使用 -PublishingProfileExcludeFromLatest。
示例 3:更改映像版本的生命周期结束日期。
$rgName = "myResourceGroup"
$galleryName = "myGallery"
$imageName = "myImage"
$versionName = "1.0.0"
$endOfLifeDate = "2024-08-02T00:00:00+00:00"
Update-AzGalleryImageVersion -ResourceGroupName $rgname -GalleryName $galleryName -GalleryImageDefinitionName $imageName -Name $versionName -PublishingProfileEndOfLifeDate $endOfLifeDate
更新库映像版本的生命周期结束日期。 映像版本仍可用于在生命周期结束日期后创建虚拟机。
示例 4:更新以删除 TargetExtendedLocations。
$rgName = "myResourceGroup"
$galleryName = "myGallery"
$imageName = "myImage"
$versionName = "1.0.0"
Update-AzGalleryImageVersion -ResourceGroupName $rgname -GalleryName $galleryName -GalleryImageDefinitionName $imageName -Name $versionName -TargetExtendedLocation @() -AllowDeletionOfReplicatedLocation $True
更新库映像版本以删除现有目标扩展位置。 传入 -TargetExtendedLocation 的空数组,并将 -AllowDeletionOfReplicatedLocation 设置为 true。
参数
-AllowDeletionOfReplicatedLocation
指示是否允许从复制区域删除此库映像版本。
参数属性
| 类型: | Boolean
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-AsJob
在后台运行 cmdlet
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-BlockDeletionBeforeEndOfLife
客户将通过此布尔值来启用其 GalleryImageVersion 资源,防止意外删除。 如果此布尔值设置为 true,则会在其 EndOfLife 日期之前阻止图像删除。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-GalleryImageDefinitionName
库映像定义的名称。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | GalleryImageName |
参数集
DefaultParameter
| Position: | 2 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-GalleryName
库的名称。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
DefaultParameter
| Position: | 1 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
PS 库映像版本对象。
ObjectParameter
| Position: | 0 |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Name
库映像版本的名称。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | GalleryImageVersionName |
参数集
DefaultParameter
| Position: | 3 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-PublishingProfileEndOfLifeDate
库映像版本的生命周期结束日期。
参数属性
| 类型: | DateTime
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-PublishingProfileExcludeFromLatest
如果已设置,则从最新版本的映像定义部署的虚拟机不会使用此映像版本。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-ReplicaCount
要为每个区域创建的映像版本的副本数。
参数属性
| 类型: | Int32
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-ResourceGroupName
资源组的名称。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
DefaultParameter
| Position: | 0 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-ResourceId
库映像版本的资源 ID。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
ResourceIdParameter
| Position: | 0 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-Tag
资源标记
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-TargetExtendedLocation
要将映像版本复制到的目标扩展位置。 此属性可更新。
参数属性
| 类型: | Hashtable[]
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-TargetRegion
要将映像版本复制到的目标区域。
参数属性
| 类型: | Hashtable[]
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。
命令脚本未运行。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
输出