File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,24 @@ New-AzVm -ResourceGroupName ResourceGroup1 -Location SouthCentralUS -VM $Virtual
224
224
225
225
This example deploys a Windows VM from the marketplace in one resource group with an existing subnet in another resource group.
226
226
227
+ ### Example 6: Creating a new VM as part of a VMSS with a PlatformFaultDomain value.
228
+ ```
229
+ $resourceGroupName= <Resource Group Name>
230
+ $domainNameLabel = <Domain Name Label Name>
231
+ $vmname = "<Virtual Machine Name>
232
+ $platformFaultDomainVMDefaultSet = 2
233
+ $securePassword = <Password> | ConvertTo-SecureString -AsPlainText -Force
234
+ $user = <Username>
235
+ $cred = New-Object System.Management.Automation.PSCredential ($user, $securePassword)
236
+ $vmssName = <Vmss Name>;
237
+
238
+ $vmssConfig = New-AzVmssConfig -Location $loc -PlatformFaultDomainCount $vmssFaultDomain;
239
+ $vmss = New-AzVmss -ResourceGroupName $resourceGroupName -Name $vmssName -VirtualMachineScaleSet $vmssConfig;
240
+
241
+ $vm = New-AzVM -ResourceGroupName $resourceGroupName -Name $vmname -Credential $cred -DomainNameLabel $domainNameLabel -PlatformFaultDomain $platformFaultDomainVMDefaultSet -VmssId $vmss.Id
242
+
243
+ ```
244
+
227
245
## PARAMETERS
228
246
229
247
### -AddressPrefix
You can’t perform that action at this time.
0 commit comments