Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Add-AzureVMNetworkInterface

Add-AzureVMNetworkInterface

microsoft.azure.commands.compute.dll

Synopsis

Add a Network Interface to the VM

Syntax

Add-AzureVMNetworkInterface [-VM] [-Id] [-Primary] [-Profile] [-InformationAction] [-InformationVariable] [<CommonParameters>]

Detailed Description

This cmdlets allows you to add a NIC to the VM at creation time or to an existing VM

Parameters

-VM <PSVirtualMachine>

Local VM Object to add the Network Interface to. The local VM object can be created with New-AzureVMConfig cmdlet or gotten through the Get-AzureVM cmdlet.

Aliases

None

Required?

true

Position

0

Default value

None

Accept pipeline input?

true (ByValue, ByPropertyName)

Accept wildcard characters?

false

-Id <String>

Id of the Network Interface. This can be gotten using the Get-AzureNetworkInterface cmdlet.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Primary <SwitchParameter>

Aliases

None

Required?

false

Position

2

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Profile <AzureProfile>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InformationAction <ActionPreference>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InformationVariable <String>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type


Return Type


Notes

Examples

-------------------------- Add a Network Interface to a new VM --------------------------

# Get the VM
$vm = Get-AzureVM -ResourceGroupName "myRG" -Name "crpVM

# Add a Network Interface to the VM
Add-AzureVMNetworkInterface –VM $vm –Id "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Network/NetworkAdapters/Nic1"

-------------------------- Add a Network Interface to an existing VM --------------------------

# Get the VM
$vm = Get-AzureVM -ResourceGroupName "myRG" -Name "crpVM"

# Add a Network Interface to the VM
Add-AzureVMNetworkInterface –VM $vm –Id "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Network/NetworkAdapters/Nic1"

# Update VM state
Update-AzureVM -ResourceGroupName "myRG" -Name "crpVM" –VM $vm