Edit

Share via


Update-AzGalleryImageVersion

Update a gallery image version.

Syntax

DefaultParameter (Default)

Update-AzGalleryImageVersion
    [-ResourceGroupName] <String>
    [-GalleryName] <String>
    [-GalleryImageDefinitionName] <String>
    [-Name] <String>
    [-AsJob]
    [-PublishingProfileEndOfLifeDate <DateTime>]
    [-PublishingProfileExcludeFromLatest]
    [-ReplicaCount <Int32>]
    [-Tag <Hashtable>]
    [-TargetRegion <Hashtable[]>]
    [-TargetExtendedLocation <Hashtable[]>]
    [-AllowDeletionOfReplicatedLocation <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>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ObjectParameter

Update-AzGalleryImageVersion
    [-InputObject] <PSGalleryImageVersion>
    [-AsJob]
    [-PublishingProfileEndOfLifeDate <DateTime>]
    [-PublishingProfileExcludeFromLatest]
    [-ReplicaCount <Int32>]
    [-Tag <Hashtable>]
    [-TargetRegion <Hashtable[]>]
    [-TargetExtendedLocation <Hashtable[]>]
    [-AllowDeletionOfReplicatedLocation <Boolean>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Update a gallery image version.

Examples

Example 1: Change the replication regions and replica count

$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

Update a gallery image version's regions.

Example 2: Change whether an image version should be considered for latest.

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$imageName = "myImage"
$versionName = "1.0.0"
Update-AzGalleryImageVersion -ResourceGroupName $rgname -GalleryName $galleryName -GalleryImageDefinitionName $imageName -Name $versionName -PublishingProfileExcludeFromLatest:$false

Update a gallery image version's exclude from latest status. To include an image version in consideration for latest, use -PublishingProfileExcludeFromLatest:$false. To exclude an image version from consideration for latest, use -PublishingProfileExcludeFromLatest.

Example 3: Change the end-of-life date for an image version.

$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

Update a gallery image version's end-of-life date. The image version can still be used to create virtual machines after the end-of-life date.

Example 4: Update to remove TargetExtendedLocations.

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$imageName = "myImage"
$versionName = "1.0.0"

Update-AzGalleryImageVersion -ResourceGroupName $rgname -GalleryName $galleryName -GalleryImageDefinitionName $imageName -Name $versionName -TargetExtendedLocation @() -AllowDeletionOfReplicatedLocation $True

Update a gallery image version to remove existing target extended locations. Pass in an empty array for -TargetExtendedLocation and set -AllowDeletionOfReplicatedLocation to true.

Parameters

-AllowDeletionOfReplicatedLocation

Indicates whether or not removing this Gallery Image Version from replicated regions is allowed.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-AsJob

Run cmdlet in the background

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-GalleryImageDefinitionName

The name of the gallery image definition.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:GalleryImageName

Parameter sets

DefaultParameter
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-GalleryName

The name of the gallery.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

DefaultParameter
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-InputObject

The PS Gallery Image Version Object.

Parameter properties

Type:PSGalleryImageVersion
Default value:None
Supports wildcards:False
DontShow:False
Aliases:GalleryImageVersion

Parameter sets

ObjectParameter
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

The name of the gallery image version.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:GalleryImageVersionName

Parameter sets

DefaultParameter
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PublishingProfileEndOfLifeDate

The end of life date of the gallery Image Version.

Parameter properties

Type:DateTime
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PublishingProfileExcludeFromLatest

If it is set, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ReplicaCount

The number of replicas of the Image Version to be created per region.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceGroupName

The name of the resource group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

DefaultParameter
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceId

The resource ID for the gallery image version.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ResourceIdParameter
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Tag

Resource tags

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-TargetExtendedLocation

The target extended locations where the Image Version is going to be replicated to. This property is updatable.

Parameter properties

Type:

Hashtable[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-TargetRegion

The target regions where the Image Version is going to be replicated to.

Parameter properties

Type:

Hashtable[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

PSGalleryImageVersion

Hashtable

Int32

SwitchParameter

DateTime

Hashtable

Outputs

PSGalleryImageVersion