File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
articles/virtual-network/ip-services Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -64,15 +64,14 @@ The following command changes the private IP address of the virtual machine to s
64
64
``` azurepowershell-interactive
65
65
## Place virtual network configuration into a variable. ##
66
66
$net = @{
67
- Name = 'myResourceGroup-vnet '
67
+ Name = 'myVM '
68
68
ResourceGroupName = 'myResourceGroup'
69
69
}
70
70
$vnet = Get-AzVirtualNetwork @net
71
71
72
72
## Place subnet configuration into a variable. ##
73
73
$sub = @{
74
- Name = 'default'
75
- ResourceGroupName = 'myResourceGroup'
74
+ Name = 'myVM'
76
75
VirtualNetwork = $vnet
77
76
}
78
77
$subnet = Get-AzVirtualNetworkSubnetConfig @sub
@@ -89,8 +88,8 @@ $nic = Get-AzNetworkInterface -ResourceId $vm.NetworkProfile.NetworkInterfaces.I
89
88
90
89
## Set interface configuration. ##
91
90
$config =@{
92
- Name = 'ipconfig1 '
93
- PrivateIpAddress = '10.0.0 .4'
91
+ Name = 'myVM '
92
+ PrivateIpAddress = '192.168.1 .4'
94
93
Subnet = $subnet
95
94
}
96
95
$nic | Set-AzNetworkInterfaceIpConfig @config -Primary
You can’t perform that action at this time.
0 commit comments