Set-AzureVMExtension
設定虛擬機的資源延伸模組。
注意
本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰。
Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (ARM) 資源的建議 PowerShell 模組。
語法
Set-AzureVMExtension
[-ExtensionName] <String>
[-Publisher] <String>
[-Version] <String>
[[-ReferenceName] <String>]
[[-PublicConfiguration] <String>]
[[-PrivateConfiguration] <String>]
[-Disable]
[-Uninstall]
[[-PublicConfigKey] <String>]
[[-PrivateConfigKey] <String>]
[-ForceUpdate]
-VM <IPersistentVM>
[-Profile <AzureSMProfile>]
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[<CommonParameters>]
Set-AzureVMExtension
[-ExtensionName] <String>
[-Publisher] <String>
[-Version] <String>
[[-ReferenceName] <String>]
[[-PublicConfigPath] <String>]
[[-PrivateConfigPath] <String>]
[-Disable]
[-Uninstall]
[[-PublicConfigKey] <String>]
[[-PrivateConfigKey] <String>]
[-ForceUpdate]
-VM <IPersistentVM>
[-Profile <AzureSMProfile>]
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[<CommonParameters>]
Set-AzureVMExtension
[-ReferenceName] <String>
[[-PublicConfiguration] <String>]
[[-PrivateConfiguration] <String>]
[-Disable]
[-Uninstall]
[[-PublicConfigKey] <String>]
[[-PrivateConfigKey] <String>]
[-ForceUpdate]
-VM <IPersistentVM>
[-Profile <AzureSMProfile>]
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[<CommonParameters>]
Set-AzureVMExtension
[-ReferenceName] <String>
[[-PublicConfigPath] <String>]
[[-PrivateConfigPath] <String>]
[-Disable]
[-Uninstall]
[[-PublicConfigKey] <String>]
[[-PrivateConfigKey] <String>]
[-ForceUpdate]
-VM <IPersistentVM>
[-Profile <AzureSMProfile>]
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[<CommonParameters>]
Description
Set-AzureVMExtension Cmdlet 會設定虛擬機的資源延伸模組。
範例
範例 1:建立已套用資源延伸模組的虛擬機
PS C:\> $X = New-AzureVMConfig -Name $VM -InstanceSize Small -ImageName $IMG;$X = Add-AzureProvisioningConfig -VM $X -Password $PWD -AdminUsername $USR -Windows;$X = Set-AzureVMExtension -VM $X -ExtensionName $Ext1 -Publisher $Publisher -Version $VER -PublicConfiguration $P1 -PrivateConfiguration $P2;$X = Set-AzureVMExtension -VM $X -ExtensionName $Ext2 -Publisher $Publisher -Version $VER -PublicConfiguration $P3 -PrivateConfiguration $P4;New-AzureVM -Location $LOC -ServiceName $SVC -VM $X;
此命令會建立已套用資源延伸模組的虛擬機。
參數
-Disable
表示此 Cmdlet 會停用擴充功能狀態。
類型: | SwitchParameter |
Position: | 7 |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-ExtensionName
指定虛擬機的延伸模組名稱。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ForceUpdate
指出當設定尚未更新時,此 Cmdlet 會將設定重新套用至擴充功能。
類型: | SwitchParameter |
Position: | 11 |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-InformationAction
指定此 Cmdlet 如何回應資訊事件。
此參數可接受的值為:
- 繼續
- 忽略
- 詢問
- SilentlyContinue
- 停止
- 暫止
類型: | ActionPreference |
別名: | infa |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-InformationVariable
指定資訊變數。
類型: | String |
別名: | iv |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-PrivateConfigKey
指定私鑰。
類型: | String |
Position: | 10 |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-PrivateConfigPath
指定私人組態路徑。
類型: | String |
Position: | 6 |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-PrivateConfiguration
指定私人組態文字。
類型: | String |
Position: | 6 |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-Profile
指定此 Cmdlet 從中讀取的 Azure 設定檔。 如果您未指定設定檔,此 Cmdlet 會從本機預設配置檔讀取。
類型: | AzureSMProfile |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-PublicConfigKey
指定公用組態金鑰。
類型: | String |
Position: | 9 |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-PublicConfigPath
指定公用組態路徑。
類型: | String |
Position: | 5 |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-PublicConfiguration
指定公用組態文字。
類型: | String |
Position: | 5 |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-Publisher
指定延伸模組的發行者。
類型: | String |
Position: | 2 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ReferenceName
指定延伸模組的參考名稱。
這是使用者定義字串,可用來參考延伸模組。 當您第一次將擴充功能新增至虛擬機時,您必須指定它。 針對後續更新,您必須在更新延伸模組時指定先前使用的參考名稱。 指派給擴充功能的 ReferenceName 會使用 Get-AzureVM Cmdlet 傳回。
類型: | String |
Position: | 4 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-Uninstall
指出此 Cmdlet 會從虛擬機卸載資源擴充功能。
類型: | SwitchParameter |
Position: | 8 |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-Version
指定擴充功能版本。
類型: | String |
Position: | 3 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-VM
指定持續性虛擬機物件。
類型: | IPersistentVM |
別名: | InputObject |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |