Skip to content

Commit 0635d12

Browse files
authored
Merge pull request #7186 from praries880/6989_fix
6989 fix : Add example for simple param set to the New-AzureRmVmss cmdlet hep
2 parents 72bcfc8 + 0fd7b33 commit 0635d12

File tree

2 files changed

+45
-21
lines changed

2 files changed

+45
-21
lines changed

src/ResourceManager/Compute/Commands.Compute/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
- Additional information about change #1
2020
-->
2121
## Current Release
22+
* Added an example of the `SimpleParameterSet` to New-AzureRmVmss cmdlet help.
23+
2224

2325
## Version 5.6.0
2426
* Move dependencies on Keyvault and Storage to the common dependencies

src/ResourceManager/Compute/Commands.Compute/help/New-AzureRmVmss.md

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,34 @@ New-AzureRmVmss [[-ResourceGroupName] <String>] [-VMScaleSetName] <String> [-AsJ
3636

3737
## DESCRIPTION
3838
The **New-AzureRmVmss** cmdlet creates a Virtual Machine Scale Set (VMSS) in Azure.
39-
This cmdlet takes a **VirtualMachineScaleSet** object as input.
39+
Use the simple parameter set (`SimpleParameterSet`) to quickly create a pre-set VMSS and associated resources. Use the default parameter set (`DefaultParameter`) for more advanced scenarios when you need to precisely configure each component of the the VMSS and each associated resource before creation.
4040

4141
## EXAMPLES
4242

43-
### Example 1: Create a VMSS
43+
### Example 1: Create a VMSS using the **`SimpleParameterSet`**
44+
```powershell
45+
$vmssName = <VMSSNAME>
46+
# Create credentials, I am using one way to create credentials, there are others as well.
47+
# Pick one that makes the most sense according to your use case.
48+
$vmPassword = ConvertTo-SecureString <PASSWORD_HERE> -AsPlainText -Force
49+
$vmCred = New-Object System.Management.Automation.PSCredential(<USERNAME_HERE>, $vmPassword)
50+
51+
#Create a VMSS using the default settings
52+
New-AzureRmVmss -Credential $vmCred -VMScaleSetName $vmssName
4453
```
54+
55+
The command above creates the following with the name `$vmssName` :
56+
* A Resource Group
57+
* A virtual network
58+
* A load balancer
59+
* A public IP
60+
* the VMSS with 2 instances
61+
62+
The default image chosen for the VMs in the VMSS is `2016-Datacenter Windows Server` and the SKU is `Standard_DS1_v2`
63+
64+
65+
### Example 2: Create a VMSS using the **`DefaultParameterSet`**
66+
``` powershell
4567
# Common
4668
$LOC = "WestUs";
4769
$RGName = "rgkyvms";
@@ -123,25 +145,25 @@ $VMSS = New-AzureRmVmssConfig -Location $LOC -SkuCapacity 2 -SkuName "Standard_A
123145
New-AzureRmVmss -ResourceGroupName $RGName -Name $VMSSName -VirtualMachineScaleSet $VMSS;
124146
```
125147

126-
The following complex example creates a VMSS.
127-
The first command creates a resource group with the specified name and location.
128-
The second command uses the **New-AzureRmStorageAccount** cmdlet to create a storage account.
129-
The third command then uses the **Get-AzureRmStorageAccount** cmdlet to get the storage account created in the second command and stores the result in the $STOAccount variable.
130-
The fifth command uses the **New-AzureRmVirtualNetworkSubnetConfig** cmdlet to create a subnet and stores the result in the variable named $SubNet.
131-
The sixth command uses the **New-AzureRmVirtualNetwork** cmdlet to create a virtual network and stores the result in the variable named $VNet.
132-
The seventh command uses the **Get-AzureRmVirtualNetwork** to get information about the virtual network created in the sixth command and stores the information in the variable named $VNet.
133-
The eighth and ninth command uses the **New-AzureRmPublicIpAddress** and **Get- AzureRmPublicIpAddress** to create and get information from that public IP address.
134-
The commands store the information in the variable named $PubIP.
135-
The tenth command uses the **New- AzureRmLoadBalancerFrontendIpConfig** cmdlet to create a frontend load balancer and stores the result in the variable named $Frontend.
136-
The eleventh command uses the **New-AzureRmLoadBalancerBackendAddressPoolConfig** to create a backend address pool configuration and stores the result in the variable named $BackendAddressPool.
137-
The twelfth command uses the **New-AzureRmLoadBalancerProbeConfig** to create a probe and stores the probe information in the variable named $Probe.
138-
The thirteenth command uses the **New-AzureRmLoadBalancerInboundNatPoolConfig** cmdlet to create a load balancer inbound network address translation (NAT) pool configuration.
139-
The fourteenth command uses the **New-AzureRmLoadBalancerRuleConfig** to create a load balancer rule configuration and stores the result in the variable named $LBRule.
140-
The fifteenth command uses the **New-AzureRmLoadBalancer** cmdlet to create a load balancer and stores the result in the variable named $ActualLb.
141-
The sixteenth command uses the **Get-AzureRmLoadBalancer** to get information about the load balancer that was created in the fifteenth command and stores the information in the variable named $ExpectedLb.
142-
The seventeenth command uses the **New-AzureRmVmssIPConfig** cmdlet to create a VMSS IP configuration and stores the information in the variable named $IPCfg.
143-
The eighteenth command uses the **New-AzureRmVmssConfig** cmdlet to create a VMSS configuration object and stores the result in the variable named $VMSS.
144-
The nineteenth command uses the **New-AzureRmVmss** cmdlet to create the VMSS.
148+
The complex example above creates a VMSS, following is an explanation of what is happening:
149+
* The first command creates a resource group with the specified name and location.
150+
* The second command uses the **New-AzureRmStorageAccount** cmdlet to create a storage account.
151+
* The third command then uses the **Get-AzureRmStorageAccount** cmdlet to get the storage account created in the second command and stores the result in the $STOAccount variable.
152+
* The fifth command uses the **New-AzureRmVirtualNetworkSubnetConfig** cmdlet to create a subnet and stores the result in the variable named $SubNet.
153+
* The sixth command uses the **New-AzureRmVirtualNetwork** cmdlet to create a virtual network and stores the result in the variable named $VNet.
154+
* The seventh command uses the **Get-AzureRmVirtualNetwork** to get information about the virtual network created in the sixth command and stores the information in the variable named $VNet.
155+
* The eighth and ninth command uses the **New-AzureRmPublicIpAddress** and **Get- AzureRmPublicIpAddress** to create and get information from that public IP address.
156+
* The commands store the information in the variable named $PubIP.
157+
* The tenth command uses the **New- AzureRmLoadBalancerFrontendIpConfig** cmdlet to create a frontend load balancer and stores the result in the variable named $Frontend.
158+
* The eleventh command uses the **New-AzureRmLoadBalancerBackendAddressPoolConfig** to create a backend address pool configuration and stores the result in the variable named $BackendAddressPool.
159+
* The twelfth command uses the **New-AzureRmLoadBalancerProbeConfig** to create a probe and stores the probe information in the variable named $Probe.
160+
* The thirteenth command uses the **New-AzureRmLoadBalancerInboundNatPoolConfig** cmdlet to create a load balancer inbound network address translation (NAT) pool configuration.
161+
* The fourteenth command uses the **New-AzureRmLoadBalancerRuleConfig** to create a load balancer rule configuration and stores the result in the variable named $LBRule.
162+
* The fifteenth command uses the **New-AzureRmLoadBalancer** cmdlet to create a load balancer and stores the result in the variable named $ActualLb.
163+
* The sixteenth command uses the **Get-AzureRmLoadBalancer** to get information about the load balancer that was created in the fifteenth command and stores the information in the variable named $ExpectedLb.
164+
* The seventeenth command uses the **New-AzureRmVmssIPConfig** cmdlet to create a VMSS IP configuration and stores the information in the variable named $IPCfg.
165+
* The eighteenth command uses the **New-AzureRmVmssConfig** cmdlet to create a VMSS configuration object and stores the result in the variable named $VMSS.
166+
* The nineteenth command uses the **New-AzureRmVmss** cmdlet to create the VMSS.
145167

146168
## PARAMETERS
147169

0 commit comments

Comments
 (0)