Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b7c8d3d

Browse files
committedSep 22, 2021
freshness update for create vm with static private IP address for ip services redesign
1 parent 898cd72 commit b7c8d3d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
 

‎articles/virtual-network/ip-services/virtual-networks-static-private-ip-arm-ps.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,14 @@ The following command changes the private IP address of the virtual machine to s
6464
```azurepowershell-interactive
6565
## Place virtual network configuration into a variable. ##
6666
$net = @{
67-
Name = 'myResourceGroup-vnet'
67+
Name = 'myVM'
6868
ResourceGroupName = 'myResourceGroup'
6969
}
7070
$vnet = Get-AzVirtualNetwork @net
7171
7272
## Place subnet configuration into a variable. ##
7373
$sub = @{
74-
Name = 'default'
75-
ResourceGroupName = 'myResourceGroup'
74+
Name = 'myVM'
7675
VirtualNetwork = $vnet
7776
}
7877
$subnet = Get-AzVirtualNetworkSubnetConfig @sub
@@ -89,8 +88,8 @@ $nic = Get-AzNetworkInterface -ResourceId $vm.NetworkProfile.NetworkInterfaces.I
8988
9089
## Set interface configuration. ##
9190
$config =@{
92-
Name = 'ipconfig1'
93-
PrivateIpAddress = '10.0.0.4'
91+
Name = 'myVM'
92+
PrivateIpAddress = '192.168.1.4'
9493
Subnet = $subnet
9594
}
9695
$nic | Set-AzNetworkInterfaceIpConfig @config -Primary

0 commit comments

Comments
 (0)
Please sign in to comment.