Remove-AzStackHCIVMVirtualMachineNetworkInterface

The operation to delete a network interface from a virtual machine.

Syntax

Remove-AzStackHCIVMVirtualMachineNetworkInterface
      -ResourceId <String>
      [-NicId <String[]>]
      [-NicName <String[]>]
      [-NicResourceGroup <String>]
      [-NoWait]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzStackHCIVMVirtualMachineNetworkInterface
      -Name <String>
      -ResourceGroupName <String>
      [-SubscriptionId <String>]
      [-NicId <String[]>]
      [-NicName <String[]>]
      [-NicResourceGroup <String>]
      [-NoWait]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The operation to delete a network interface from a virtual machine.

Examples

Example 1: Removes a Network Interface from a Virtual Machine

Remove-AzStackHCIVMVirtualMachineNetworkInterface  -Name "testVm" -ResourceGroupName "test-rg"  -NicName 'testNic'

Name            ResourceGroupName
----            -----------------
testVm          test-rg

This command removes a network interface from the virtual machine in the specified resource group.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Name of the virtual machine

Type:String
Aliases:VirtualMachineName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NicId

NetworkInterfaces - list of network interfaces to be attached from the virtual machine in id format.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NicName

NetworkInterfaces - list of network interfaces to be removed from the virtual machine in name format.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NicResourceGroup

NetworkInterfaces - resource group of the network interfaces

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NoWait

Run the command asynchronously

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group. The name is case insensitive.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

The ARM Resource ID of the virtual machine.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The ID of the target subscription.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

IVirtualMachineInstance