Skip to content

Commit a9d7585

Browse files
committed
example
1 parent 32817a1 commit a9d7585

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Compute/Compute/help/New-AzVM.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,24 @@ New-AzVm -ResourceGroupName ResourceGroup1 -Location SouthCentralUS -VM $Virtual
224224

225225
This example deploys a Windows VM from the marketplace in one resource group with an existing subnet in another resource group.
226226

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+
227245
## PARAMETERS
228246

229247
### -AddressPrefix

0 commit comments

Comments
 (0)