Skip to content

Commit 5fe64d0

Browse files
authored
Merge pull request Azure#3447 from anavinahar/helpexamples
Adding missing examples for Network cmlets
2 parents a2fbfd9 + 5424066 commit 5fe64d0

6 files changed

+203
-11
lines changed

src/ResourceManager/Network/Commands.Network/Microsoft.Azure.Commands.Network.dll-Help.xml

Lines changed: 134 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15281,6 +15281,28 @@ PS C:\> Get-AzureRmLoadBalancerRuleConfig -Name "MyLBrulename" -Loa
1528115281
</maml:alert>
1528215282
</maml:alertSet>
1528315283
<command:examples>
15284+
<command:example>
15285+
<maml:title>-------------------------- Example 1 Get an IP configuration of a network interface --------------------------</maml:title>
15286+
<maml:introduction>
15287+
<maml:paragraph>PS C:\&gt;</maml:paragraph>
15288+
</maml:introduction>
15289+
<dev:code>PS C:\&gt; $nic1 = Get-AzureRmNetworkInterface -Name mynic -ResourceGroupName $myrg
15290+
15291+
PS C:\&gt; Get-AzureRmNetworkInterfaceIpConfig -Name ipconfig1 -NetworkInterface $nic1</dev:code>
15292+
<dev:remarks>
15293+
<maml:para>The first command gets an existing network interface called mynic and stores it in the variable $nic1. The second command gets the IP configuration called ipconfig1 of this network interface.</maml:para>
15294+
<maml:para />
15295+
<maml:para />
15296+
<maml:para></maml:para>
15297+
</dev:remarks>
15298+
<command:commandLines>
15299+
<command:commandLine>
15300+
<command:commandText>
15301+
<maml:para />
15302+
</command:commandText>
15303+
</command:commandLine>
15304+
</command:commandLines>
15305+
</command:example>
1528415306
</command:examples>
1528515307
<maml:relatedLinks>
1528615308
</maml:relatedLinks>
@@ -27738,6 +27760,61 @@ New-AzureRmNetworkInterface -Name NetworkInterface1 -ResourceGroupName ResourceG
2773827760
</maml:alert>
2773927761
</maml:alertSet>
2774027762
<command:examples>
27763+
<command:example>
27764+
<maml:title>-------------------------- Example 1 Create an IP configuration with a public IP address for a network interface --------------------------</maml:title>
27765+
<maml:introduction>
27766+
<maml:paragraph>PS C:\&gt;</maml:paragraph>
27767+
</maml:introduction>
27768+
<dev:code>PS C:\&gt; $vnet = Get-AzureRmVirtualNetwork -Name myvnet -ResourceGroupName myrg
27769+
PS C:\&gt; $Subnet = Get-AzureRmVirtualNetworkSubnetConfig -Name mysubnet -VirtualNetwork $vnet
27770+
PS C:\&gt; $PIP1 = Get-AzureRmPublicIPAddress -Name &quot;PIP1&quot; -ResourceGroupName &quot;RG1&quot;
27771+
27772+
PS C:\&gt; $IPConfig1 = New-AzureRmNetworkInterfaceIpConfig -Name &quot;IPConfig-1&quot; -Subnet $Subnet -PublicIpAddress $PIP1 -Primary
27773+
27774+
PS C:\&gt; $nic = New-AzureRmNetworkInterface -Name $NicName -ResourceGroupName myrg -Location westus -IpConfiguration $IpConfig1
27775+
</dev:code>
27776+
<dev:remarks>
27777+
<maml:para>The first two commands get a virtual network called myvnet and a subnet called mysubnet respectively that were previously created. These are stored in $vnet and $Subnet respectively. The third command gets a previously created public IP address called PIP1. The forth command creates a new IP configuration called &quot;IPConfig-1&quot; as the primary IP configuration with a public IP address associated with it.
27778+
The last command then creates a network interface called mynic1 using this IP configuration.</maml:para>
27779+
<maml:para />
27780+
<maml:para />
27781+
<maml:para></maml:para>
27782+
</dev:remarks>
27783+
<command:commandLines>
27784+
<command:commandLine>
27785+
<command:commandText>
27786+
<maml:para />
27787+
</command:commandText>
27788+
</command:commandLine>
27789+
</command:commandLines>
27790+
</command:example>
27791+
<command:example>
27792+
<maml:title>-------------------------- Example 2 Create an IP configuration with a private IP address --------------------------</maml:title>
27793+
<maml:introduction>
27794+
<maml:paragraph>PS C:\&gt;</maml:paragraph>
27795+
</maml:introduction>
27796+
<dev:code>PS C:\&gt; $vnet = Get-AzureRmVirtualNetwork -Name myvnet -ResourceGroupName myrg
27797+
PS C:\&gt; $Subnet = Get-AzureRmVirtualNetworkSubnetConfig -Name mysubnet -VirtualNetwork $vnet
27798+
27799+
27800+
PS C:\&gt; $IPConfig2 = New-AzureRmNetworkInterfaceIpConfig -Name &quot;IP-Config2&quot; -Subnet $Subnet -PrivateIpAddress 10.0.0.5
27801+
27802+
PS C:\&gt; $nic = New-AzureRmNetworkInterface -Name mynic1 -ResourceGroupName myrg -Location westus -IpConfiguration $IpConfig2</dev:code>
27803+
<dev:remarks>
27804+
<maml:para>The first two commands get a virtual network called myvnet and a subnet called mysubnet respectively that were previously created. These are stored in $vnet and $Subnet respectively. The third command creates a new IP configuration called &quot;IPConfig-2&quot; with a private IP address 10.0.0.5 associated with it.
27805+
The last command then creates a network interface called mynic1 using this IP configuration.</maml:para>
27806+
<maml:para />
27807+
<maml:para />
27808+
<maml:para></maml:para>
27809+
</dev:remarks>
27810+
<command:commandLines>
27811+
<command:commandLine>
27812+
<command:commandText>
27813+
<maml:para />
27814+
</command:commandText>
27815+
</command:commandLine>
27816+
</command:commandLines>
27817+
</command:example>
2774127818
</command:examples>
2774227819
<maml:relatedLinks>
2774327820
</maml:relatedLinks>
@@ -35729,13 +35806,15 @@ InboundNatPools : []</maml:para>
3572935806
</maml:alertSet>
3573035807
<command:examples>
3573135808
<command:example>
35732-
<maml:title>-------------------------- 1: --------------------------</maml:title>
35809+
<maml:title>-------------------------- 1: Delete an inbound NAT rule from an Azure load balancer --------------------------</maml:title>
3573335810
<maml:introduction>
3573435811
<maml:paragraph>PS C:\&gt;</maml:paragraph>
3573535812
</maml:introduction>
35736-
<dev:code></dev:code>
35813+
<dev:code>PS C:\&gt; $loadbalancer = Get-AzureRmLoadBalancer -Name mylb -ResourceGroupName myrg
35814+
35815+
PS C:\&gt; Remove-AzureRmLoadBalancerInboundNatRuleConfig -Name &quot;myinboundnatrule&quot; -LoadBalancer $loadbalancer</dev:code>
3573735816
<dev:remarks>
35738-
<maml:para />
35817+
<maml:para>The first command loads an already existing load balancer called &quot;mylb&quot; and stores it in the variable $load balancer. The second command removes the inbound NAT rule associated with this load balancer.</maml:para>
3573935818
<maml:para />
3574035819
<maml:para />
3574135820
<maml:para></maml:para>
@@ -36807,6 +36886,28 @@ PS C:&gt; Remove-AzureRmLoadBalancerRuleConfig -Name &quot;MyLBruleName&quot; -
3680736886
</maml:alert>
3680836887
</maml:alertSet>
3680936888
<command:examples>
36889+
<command:example>
36890+
<maml:title>-------------------------- Example 1 Delete an IP configuration from a network interface --------------------------</maml:title>
36891+
<maml:introduction>
36892+
<maml:paragraph>PS C:\&gt;</maml:paragraph>
36893+
</maml:introduction>
36894+
<dev:code>PS C:\&gt; $nic = Get-AzureRmNetworkInterface -Name mynic -ResourceGroupName myrg
36895+
36896+
PS C:\&gt; Remove-AzureRmNetworkInterfaceIpConfig -Name IPConfig-1 -NetworkInterface $nic</dev:code>
36897+
<dev:remarks>
36898+
<maml:para>The first command gets a network interface called mynic and stores it in the variable $nic. The second command removes the IP configuration called IPConfig-1 associated with this network interface.</maml:para>
36899+
<maml:para />
36900+
<maml:para />
36901+
<maml:para></maml:para>
36902+
</dev:remarks>
36903+
<command:commandLines>
36904+
<command:commandLine>
36905+
<command:commandText>
36906+
<maml:para />
36907+
</command:commandText>
36908+
</command:commandLine>
36909+
</command:commandLines>
36910+
</command:example>
3681036911
</command:examples>
3681136912
<maml:relatedLinks>
3681236913
</maml:relatedLinks>
@@ -47807,6 +47908,36 @@ Set-AzureRmNetworkInterface -NetworkInterface $nic</dev:code>
4780747908
</maml:alert>
4780847909
</maml:alertSet>
4780947910
<command:examples>
47911+
<command:example>
47912+
<maml:title>-------------------------- Example 1 Changing the IP address of an IP configuration --------------------------</maml:title>
47913+
<maml:introduction>
47914+
<maml:paragraph>PS C:\&gt;</maml:paragraph>
47915+
</maml:introduction>
47916+
<dev:code>PS C:\&gt; $vnet = Get-AzureRmVirtualNetwork -Name myvnet -ResourceGroupName myrg
47917+
PS C:\&gt; $subnet = Get-AzureRmVirtualNetworkSubnetConfig -Name mysubnet -VirtualNetwork $vnet
47918+
47919+
PS C:\&gt; $nic = Get-AzureRmNetworkInterface -Name nic1 -ResourceGroupName myrg
47920+
47921+
PS C:\&gt; $nic | Set-AzureRmNetworkInterfaceIpConfig -Name ipconfig1 -PrivateIpAddress 10.0.0.11 -Subnet $subnet -Primary
47922+
47923+
PS C:\&gt; $nic | Set-AzureRmNetworkInterface
47924+
47925+
47926+
</dev:code>
47927+
<dev:remarks>
47928+
<maml:para>The first two commands get a virtual network called myvnet and a subnet called mysubnet and store it in the variables $vnet and $subnet respectively. The third command gets the network interface nic1 associated with the IP configuration that needs to be updated. The third command sets the private IP address of the primary IP configuration ipconfig1 to 10.0.0.11. Finally, the last command updates the network interface ensuring the changes have been made successfully.</maml:para>
47929+
<maml:para />
47930+
<maml:para />
47931+
<maml:para></maml:para>
47932+
</dev:remarks>
47933+
<command:commandLines>
47934+
<command:commandLine>
47935+
<command:commandText>
47936+
<maml:para />
47937+
</command:commandText>
47938+
</command:commandLine>
47939+
</command:commandLines>
47940+
</command:example>
4781047941
</command:examples>
4781147942
<maml:relatedLinks>
4781247943
</maml:relatedLinks>

src/ResourceManager/Network/Commands.Network/help/Get-AzureRmNetworkInterfaceIpConfig.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ The **Get-AzureRmNetworkInterfaceIPConfig** cmdlet gets a network interface IP c
2222

2323
## EXAMPLES
2424

25-
### 1:
25+
### 1: Get an IP configuration of a network interface
2626
```
27-
27+
$nic1 = Get-AzureRmNetworkInterface -Name mynic -ResourceGroupName $myrg
28+
Get-AzureRmNetworkInterfaceIpConfig -Name ipconfig1 -NetworkInterface $nic1
2829
```
29-
30+
The first command gets an existing network interface called mynic and stores it in the variable $nic1. The second
31+
command gets the IP configuration called ipconfig1 of this network interface.
32+
3033
## PARAMETERS
3134

3235
### -Name

src/ResourceManager/Network/Commands.Network/help/New-AzureRmNetworkInterfaceIpConfig.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,40 @@ The **New-AzureRmNetworkInterfaceIpConfig** cmdlet creates an Azure network inte
3737

3838
## EXAMPLES
3939

40-
### 1:
40+
### 1: Create an IP configuration with a public IP address for a network interface
4141
```
42+
$vnet = Get-AzureRmVirtualNetwork -Name myvnet -ResourceGroupName myrg
43+
$Subnet = Get-AzureRmVirtualNetworkSubnetConfig -Name mysubnet -VirtualNetwork $vnet
44+
$PIP1 = Get-AzureRmPublicIPAddress -Name "PIP1" -ResourceGroupName "RG1"
4245
46+
$IPConfig1 = New-AzureRmNetworkInterfaceIpConfig -Name "IPConfig-1" -Subnet $Subnet -PublicIpAddress $PIP1
47+
-Primary
48+
49+
$nic = New-AzureRmNetworkInterface -Name $NicName -ResourceGroupName myrg -Location westus
50+
-IpConfiguration $IpConfig1
51+
```
52+
53+
The first two commands get a virtual network called myvnet and a subnet called mysubnet respectively that were
54+
previously created. These are stored in $vnet and $Subnet respectively. The third command gets a previously
55+
created public IP address called PIP1. The forth command creates a new IP configuration called "IPConfig-1" as the
56+
primary IP configuration with a public IP address associated with it.
57+
The last command then creates a network interface called mynic1 using this IP configuration.
58+
59+
### 2: Create an IP configuration with a private IP address
60+
```
61+
$vnet = Get-AzureRmVirtualNetwork -Name myvnet -ResourceGroupName myrg
62+
$Subnet = Get-AzureRmVirtualNetworkSubnetConfig -Name mysubnet -VirtualNetwork $vnet
63+
64+
$IPConfig2 = New-AzureRmNetworkInterfaceIpConfig -Name "IP-Config2" -Subnet $Subnet -PrivateIpAddress
65+
10.0.0.5
66+
67+
$nic = New-AzureRmNetworkInterface -Name mynic1 -ResourceGroupName myrg -Location westus -IpConfiguration
68+
$IpConfig2
4369
```
70+
The first two commands get a virtual network called myvnet and a subnet called mysubnet respectively that were
71+
previously created. These are stored in $vnet and $Subnet respectively. The third command creates a new IP
72+
configuration called "IPConfig-2" with a private IP address 10.0.0.5 associated with it.
73+
The last command then creates a network interface called mynic1 using this IP configuration.
4474

4575
## PARAMETERS
4676

src/ResourceManager/Network/Commands.Network/help/Remove-AzureRmLoadBalancerInboundNatRuleConfig.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@ The **Remove-AzureRmLoadBalancerInboundNatRuleConfig** cmdlet removes an inbound
2222

2323
## EXAMPLES
2424

25-
### 1:
25+
### 1: Delete an inbound NAT rule from an Azure load balancer
2626
```
2727
28+
$loadbalancer = Get-AzureRmLoadBalancer -Name mylb -ResourceGroupName myrg
29+
30+
Remove-AzureRmLoadBalancerInboundNatRuleConfig -Name "myinboundnatrule" -LoadBalancer $loadbalancer
31+
2832
```
33+
The first command loads an already existing load balancer called "mylb" and stores it in the variable $load
34+
balancer. The second command removes the inbound NAT rule associated with this load balancer.
2935

3036
## PARAMETERS
3137

src/ResourceManager/Network/Commands.Network/help/Remove-AzureRmNetworkInterfaceIpConfig.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,19 @@ The **Remove-AzureRmNetworkInterfaceIpConfig** cmdlet removes a network interfac
2222

2323
## EXAMPLES
2424

25-
### 1:
25+
### 1: Delete an IP configuration from a network interface
26+
2627
```
2728
29+
$nic = Get-AzureRmNetworkInterface -Name mynic -ResourceGroupName myrg
30+
31+
Remove-AzureRmNetworkInterfaceIpConfig -Name IPConfig-1 -NetworkInterface $nic
2832
```
2933

34+
The first command gets a network interface called mynic and stores it in the variable $nic. The second command
35+
removes the IP configuration called IPConfig-1 associated with this network interface.
36+
37+
3038
## PARAMETERS
3139

3240
### -Name

src/ResourceManager/Network/Commands.Network/help/Set-AzureRmNetworkInterfaceIpConfig.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,25 @@ The **Set-AzureRmNetworkInterfaceIpConfig** cmdlet sets the goal state for an Az
3939

4040
## EXAMPLES
4141

42-
### 1:
42+
### 1: Changing the IP address of an IP configuration
4343
```
44+
$vnet = Get-AzureRmVirtualNetwork -Name myvnet -ResourceGroupName myrg
45+
$subnet = Get-AzureRmVirtualNetworkSubnetConfig -Name mysubnet -VirtualNetwork $vnet
4446
45-
```
47+
$nic = Get-AzureRmNetworkInterface -Name nic1 -ResourceGroupName myrg
48+
49+
$nic | Set-AzureRmNetworkInterfaceIpConfig -Name ipconfig1 -PrivateIpAddress 10.0.0.11 -Subnet $subnet
50+
-Primary
4651
52+
$nic | Set-AzureRmNetworkInterface
53+
54+
```
55+
The first two commands get a virtual network called myvnet and a subnet called mysubnet and store it in the
56+
variables $vnet and $subnet respectively. The third command gets the network interface nic1 associated with the IP
57+
configuration that needs to be updated. The third command sets the private IP address of the primary IP
58+
configuration ipconfig1 to 10.0.0.11. Finally, the last command updates the network interface ensuring the changes
59+
have been made successfully.
60+
4761
## PARAMETERS
4862

4963
### -Name

0 commit comments

Comments
 (0)