title: I want to get the first 3 octets of my default gateway
body: <pre><code>$g = (Get-WmiObject -Class Win32_IP4RouteTable |
       where { $_.destination -eq '0.0.0.0' -and $_.mask -eq '0.0.0.0'} |
       Sort-Object metric1 |
       select nexthop, metric1, interfaceindex).nexthop
  </code></pre>
  
  <p>This command gives me the whole ip, like <code>192.168.1.1</code>.</p>
  
  <p>I am interested in <code>192.168.1.</code>.</p>