PowerTip: Use PowerShell to Display Routing


Summary: Use Windows PowerShell to display networking routing information.

Hey, Scripting Guy! Question How can I use Windows PowerShell to display information about network connectivity issues related to
           the routing table on my server and permit me to sort the output?

Hey, Scripting Guy! Answer Use the Get-NetRoute Windows PowerShell function, and sort by interface index, nexthop, or other properties,
           for example:

Get-NetRoute | sort ifindex

Comments (2)

  1. tommymaynard says:

    The Get-NetRoute cmdlet is a part of the NetTCPIP module introduced in PowerShell 3.0. That said, it has to be PowerShell 3.0 on Windows 2012 or Windows 8, as the module and cmdlets are dependent on the underlying operating system. As suspected, it’s also
    available in PowerShell 4.0 on these same operating systems and newer (2012 R2 & 8.1). While I’m not going to fire up my PowerShell 5.0 VM, it’s safe to assume it’s included in that version as well.

  2. Larry Keyes says:

    Hi….just tried this, but can’t find "the term get-netroute is not recognized…." is this a PowerShell 5.0 function?

Skip to main content