Skip to content

Update New-AzNetworkInterface.md #11348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/Network/Network/help/New-AzNetworkInterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,17 @@ created automatically using the name IPConfiguration1.

### Example 2: Create an Azure network interface using an IP configuration object
```
PS C:\>$IPconfig = New-AzNetworkInterfaceIpConfig -Name "IPConfig1" -PrivateIpAddressVersion IPv4 -PrivateIpAddress "10.0.1.10" -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup1/providers/Microsoft.Network/virtualNetworks/VirtualNetwork1/subnets/Subnet1"
PS C:\>$Subnet = Get-AzVirtualNetwork -Name "VirtualNetwork1" -ResourceGroupName "ResourceGroup1"
PS C:\>$IPconfig = New-AzNetworkInterfaceIpConfig -Name "IPConfig1" -PrivateIpAddressVersion IPv4 -PrivateIpAddress "10.0.1.10" -SubnetId $Subnet.Subnets[0].Id
PS C:\> New-AzNetworkInterface -Name "NetworkInterface1" -ResourceGroupName "ResourceGroup1" -Location "centralus" -IpConfiguration $IPconfig
```

This example creates a new network interface using an IP configuration object. The IP configuration
object specifies a static private IPv4 address.
The first command creates a network interface IP configuration named IPConfig1 and stores the
The first command retrieves an existing specified virtual network used to assign the subnet in the second command.
The second command creates a network interface IP configuration named IPConfig1 and stores the
configuration in the variable named $IPconfig.
The second command creates a network interface named NetworkInterface1 that uses the network
The third command creates a network interface named NetworkInterface1 that uses the network
interface IP configuration stored in the variable named $IPconfig.

## PARAMETERS
Expand Down