Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
New-AzVmGalleryApplication
- Module:
- Az.Compute Module
Create a local PSVMGalleryApplication object.
Syntax
Default (Default)
New-AzVmGalleryApplication
-PackageReferenceId <String>
[-ConfigReferenceId <String>]
[-EnableAutomaticUpgrade <Bool>]
[-TreatFailureAsDeploymentFailure <Bool>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Creates a local PSVMGalleryApplication object.
Examples
Example 1
$vm = Get-AzVM -ResourceGroupName $rgName -Name $vmName
$vmGal = New-AzVmGalleryApplication -PackageReferenceId $packageRefId -ConfigReferenceId $configRefId -EnableAutomaticUpgrade $true -TreatFailureAsDeploymentFailure $true
Add-AzVmGalleryApplication -VM $vm -GalleryApplication $vmGal -Order 1
This example creates a local VMGalleryApplication object and adds it to a PSVirtualMachine object.
Parameters
-ConfigReferenceId
Configuration Reference Id of the Gallery Application.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
-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
-EnableAutomaticUpgrade
Specifies whether the underlying VM (Virtual Machine) should automatically update when a new version of the Gallery Application becomes available in the Public Image Repository (PIR) or Shared Image Gallery (SIG).
Parameter properties
| Type: | Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PackageReferenceId
Package Reference Id of the Gallery Application.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-TreatFailureAsDeploymentFailure
Determines whether a failure encountered during the application process should be treated as a deployment failure.
Parameter properties
| Type: | Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
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
None
Outputs
PSVMGalleryApplication
Azure PowerShell
Feedback
Was this page helpful?
