Resolve the best Windows route and source address to a destination
Build a paste-ready command, then review its compatibility and effects before running it.
Find-NetRoute -RemoteIPAddress <host> | Select-Object InterfaceAlias,NextHop,RouteMetric,SourceAddressComplete required fields to copy the generated command.
read-onlyno known side effects Compatibility
WindowsVerified for Windows using powershell syntax.
Operational knowledgereview due 2027-01-19
RequirementsFind-NetRouteFind-NetRoute must be installed and available on PATH.
Version supportFind-NetRoute Current supported releasesVerified for windows using powershell syntax; consult compatibility notes for platform-specific differences.
Expected signalsInterfaceAlias NextHop RouteMetric SourceAddressRepresentative successful output; values vary with the selected target and system state.
Known errorsFind-NetRoute: command not foundFind-NetRoute is missing or is not available on PATH.
VerifyFind-NetRoute -RemoteIPAddress {{host}} | Select-Object InterfaceAlias,NextHop,RouteMetric,SourceAddressThe output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01Find-NetRouteCommandRuns the Find-NetRoute stage of this one-liner.
02-RemoteIPAddressOptionConfigures Find-NetRoute with the -RemoteIPAddress option.
03<host>ParameterA value supplied in the Fill parameters section.
04|PipelinePasses the output on the left to the command on the right.
05Select-ObjectCommandRuns the Select-Object stage of this one-liner.
06InterfaceAlias,NextHop,RouteMetric,SourceAddressArgumentPasses InterfaceAlias,NextHop,RouteMetric,SourceAddress to Select-Object.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
Find-NetRoute -RemoteIPAddress 8.8.8.8 | Select-Object InterfaceAlias,NextHop,RouteMetric,SourceAddress
Example output
InterfaceAlias NextHop RouteMetric SourceAddress
-------------- ------- ----------- -------------
Ethernet 192.168.1.1 25 192.168.1.42
Illustrative output — exact values vary by system and data.
Official sources