Disconnect-VMNetworkAdapter
Disconnects a virtual network adapter from a virtual switch or Ethernet resource pool.
Disconnect-VMNetworkAdapter
[-VMName] <String[]>
[[-Name] <String[]>]
[-ComputerName <String[]>]
[-Passthru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Disconnect-VMNetworkAdapter
[-VMNetworkAdapter] <VMNetworkAdapter[]>
[-Passthru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
The Disconnect-VMNetworkAdapter cmdlet disconnects a virtual network adapter from a virtual switch or Ethernet resource pool.
PS C:\>Disconnect-VMNetworkAdapter -VMNetworkAdapter Test1
Disconnects virtual network adapter Test1.
PS C:\>Get-VMNetworkAdapter -VMName * | Where-Object {$_.SwitchName -eq 'InternetAccess'} | Disconnect-VMNetworkAdapter
Disconnects all virtual network adapters whose SwitchName is InternetAccess in all virtual machines on the local Hyper-V server.
Specifies one or more Hyper-V hosts on which a virtual network adapter is to be disconnected. NetBIOS names, IP addresses, and fully-qualified domain names are allowable. The default is the local computer - use "localhost" or a dot (".") to specify the local computer explicitly.
Type: | String[] |
Position: | Named |
Default value: | . |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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 |
Specifies the name of the virtual network adapter to be disconnected.
Type: | String[] |
Aliases: | VMNetworkAdapterName |
Position: | 1 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies that a Microsoft.HyperV.PowerShell.VMNetworkAdapter object is to be passed through to the pipeline representing the virtual network adapter to be disconnected.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of the virtual machine in which the virtual network adapter is to be disconnected.
Type: | String[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the virtual network adapter to be disconnected.
Type: | VMNetworkAdapter[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
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 |
None by default; Microsoft.HyperV.PowerShell.VMNetworkAdapter if -PassThru is specified.