$numOfArgs = $args.Length
if ($numOfArgs -gt 0)
{
	$tap=$args[0]
    $interfaceIndex = $(Get-WMIObject Win32_networkadapter | Where ServiceName -eq "tap0901" | Select -ExpandProperty InterfaceIndex)
    $ips=$(Get-WmiObject Win32_IP4RouteTable) | Where-Object {($_.InterfaceIndex -eq $interfaceIndex)} | Select -ExpandProperty Name
    foreach ($ip in  $ips) {
		netsh interface ipv4 delete address "$tap" addr=$ip gateway=all | out-null
		route delete $ip if $interfaceIndex | out-null
    }
}