共用方式為


Add-AzVmssAdditionalUnattendContent

將資訊新增至自動 Windows 安裝程式回應檔案。

語法

Add-AzVmssAdditionalUnattendContent
   [-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>
   [[-PassName] <PassNames>]
   [[-ComponentName] <ComponentNames>]
   [[-SettingName] <SettingNames>]
   [[-Content] <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Add-AzVmssAdditionalUnattendContent Cmdlet 會將資訊新增至自動 Windows 安裝程式回應檔案。

範例

範例 1:將資訊新增至自動 Windows 安裝程式回應檔案

Add-AzVmssAdditionalUnattendContent -VirtualMachineScaleSet $VMSS -ComponentName  $AUCComponentName -Content  $AUCContent -PassName $AUCPassName -SettingName  $AUCSetting

此命令會將資訊新增至自動 Windows 安裝程式回應檔案。

參數

-ComponentName

指定要使用新增內容設定的元件名稱。 唯一允許的值是 Microsoft-Windows-Shell-Setup。

類型:Nullable<T>[ComponentNames]
接受的值:MicrosoftWindowsShellSetup
Position:2
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-Confirm

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

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

-Content

指定新增至指定路徑和元件之 unattend.xml 檔案的 XML 格式化內容。

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

-DefaultProfile

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

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

-PassName

指定套用內容之傳遞的名稱。 唯一允許的值是 oobeSystem。

類型:Nullable<T>[PassNames]
接受的值:OobeSystem
Position:1
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-SettingName

指定套用內容之設定的名稱。 此參數可接受的值為:

  • FirstLogonCommands
  • AutoLogon
類型:Nullable<T>[SettingNames]
接受的值:AutoLogon, FirstLogonCommands
Position:3
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-VirtualMachineScaleSet

指定虛擬機 擴展集 物件。 您可以使用 New-AzVmssConfig Cmdlet 來建立物件。

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

-WhatIf

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

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

輸入

PSVirtualMachineScaleSet

Nullable<T>[[Microsoft.Azure.Management.Compute.Models.PassNames, Microsoft.Azure.Management.Compute, Version=23.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]

Nullable<T>[[Microsoft.Azure.Management.Compute.Models.ComponentNames, Microsoft.Azure.Management.Compute, Version=23.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]

Nullable<T>[[Microsoft.Azure.Management.Compute.Models.SettingNames, Microsoft.Azure.Management.Compute, Version=23.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]

String

輸出

PSVirtualMachineScaleSet