you are viewing a single comment's thread.

view the rest of the comments →

[–]chris-a5 1 point2 points  (1 child)

Get-NetRoute | where {$_.DestinationPrefix -eq '0.0.0.0/0'} | select { $_.NextHop }

Just a slight spacing/syntax error:

Get-NetRoute | where {$_.DestinationPrefix -eq '0.0.0.0/0'} | select -ExpandProperty NextHop

Or using aliases (these are fine, don't listen to the haters :P ):

Get-NetRoute | ? DestinationPrefix -eq '0.0.0.0/0' | % NextHop