Add-AzVmGalleryApplication

Add a GalleryApplication object to the PSVirtualMachine object.

Note

This is the previous version of our documentation. Please consult the most recent version for up-to-date information.

Syntax

Add-AzVmGalleryApplication
   -VM <PSVirtualMachine>
   -GalleryApplication <PSVMGalleryApplication>
   [-Order <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Adds a GalleryApplication object to the PSVirtualMachine object.

Examples

Example 1

$vm = Get-AzVm -ResourceGroupName $rgName -Name $vmName
$vmGal = New-AzVmGalleryApplication -PackageReferenceId $packageRefId -ConfigReferenceId $configRefId
Add-AzVmGalleryApplication -VM $vm -GalleryApplication $vmGal -Order 1

This example creates a local VMGalleryApplication object and adds it to a PSVirtualMachine object.

Parameters

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-GalleryApplication

PSVMGalleryApplication Object.

Type:PSVMGalleryApplication
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Order

Order in which the application will be install in.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VM

The PSVirtualMachine object to add a Gallery Application Reference ID.

Type:PSVirtualMachine
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

PSVirtualMachine