Tuesday, December 03, 2019

Disable/Enable network interface using PowerShell

Windows 10 update 1511 sometimes losses connection inside a VirtualBox(5.0.16) VM. Mostly it happens after the host machine recovers from sleep or hibernate. Workaround I have observed so far is to disable/enable the interface. This can get boring overtime, so below is the PowerShell script that I use to automate it.
$nic = Get-NetAdapter -Name 'O'
"Disabling nic"
$nic | Disable-NetAdapter -Confirm:$false
"Enabling nic"
$nic | Enable-NetAdapter

Note that O is the name of my network adapter.

No comments:

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04 I am planning to run qemu-system-ppc to play around QEMU ...