# list ip adresses with its interface / adaptor
Get-NetIPAddress
# get adaptor details
Get-NetAdapter -Name 'Adaptor name'
# get the interface index from its name
$InterfaceIndex = Get-NetAdapter | ? InterfaceDescription -like 'xxx*' | select -exp ifIndex
# get the routing table
Get-NetRoute
# get the IPv4 routing table
Get-NetRoute -AddressFamily IPv4
# remove a route
Remove-NetRoute -DestinationPrefix x.x.x.x/y -InterfaceIndex x -NextHop x.x.x.x -RouteMetric x -PolicyStore ActiveStore -Confirm:$false
# add a new route
New-NetRoute -DestinationPrefix x.x.x.x/y -InterfaceIndex x -NextHop x.x.x.x -RouteMetric x -PolicyStore ActiveStore
|