共用方式為


Add-AzVmssGalleryApplication

將 GalleryApplication 物件新增至 PSVirtualMachineProfile 物件。

語法

Add-AzVmssGalleryApplication
   -VirtualMachineScaleSetVM <PSVirtualMachineScaleSetVMProfile>
   -GalleryApplication <PSVMGalleryApplication>
   [-TreatFailureAsDeploymentFailure]
   [-Order <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

將 GalleryApplication 物件新增至 PSVirtualMachineProfile 物件。

範例

範例 1

$vmss = Get-AzVmss -ResourceGroupName $rgName -Name $vmssName
$vmGal = New-AzVmssGalleryApplication -PackageReferenceId $packageRefId -ConfigReferenceId $configRefId
Add-AzVmssGalleryApplication -VirtualMachineScaleSetVM $vmss.VirtualMachineProfile -GalleryApplication $vmGal -Order 1

此範例會建立本機 VMGalleryApplication 物件,並將其新增至 PSVirtualMachineScaleSetVM 物件。

參數

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-GalleryApplication

VM 資源庫應用程式物件。

類型:PSVMGalleryApplication
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Order

應用程式將安裝的順序。

類型:Int32
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-TreatFailureAsDeploymentFailure

如果為 true,VmApplication 中任何作業的任何失敗都會使部署失敗。 如果未指定,則預設為 false。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-VirtualMachineScaleSetVM

PSVirtualMachineScaleSetVMProfile 物件,以新增資源庫應用程式參考標識符。

類型:PSVirtualMachineScaleSetVMProfile
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

None

輸出

PSVirtualMachineScaleSetVMProfile