You can add new guest routes for virtual machines and modify the routes properties.

Connect to a host that runs ESX 3.5 or later.

1

View the existing routes of the virtual machine stored in the $myVM1 variable.

Get-VMGuestRoute -VM $vm1 -HostUser root -HostPassword pass1 -GuestUser user -GuestPassword pass2 -ToolsWaitSecs 50
2

View the existing routes of the guest OS stored in the $guest variable.

Get-VMGuestRoute -VMGuest $guest -HostUser root -HostPassword pass1 -GuestUser user -GuestPassword pass2
3

Add a new guest route to the virtual machine.

$route = New-VMGuestRoute -VM $vmWin -HostUser root -HostPassword pass1 -GuestUser user -GuestPassword pass2 -Destination 192.168.100.10 -Netmask 255.255.255.255 -Gateway 10.23.112.58 -Interface $interface.RouteInterfaceId -ToolsWaitSecs 50
4

Configure the guest route.

$route = Set-VMGuestRoute -VMGuestRoute $route -HostUser root -HostPassword pass1 -GuestUser user -GuestPassword pass2 -Netmask 255.255.255.254 -Gateway 10.23.112.57