title: How to use New-NetRoute without specifying the InterfaceIndex?
body: <p>As you know, we can set up routing in Windows via  </p>
  
  <pre><code>route add xxx.xxx.xxx.xxx mask yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz
  </code></pre>
  
  <p>and the OS decides which interface to use. Now, I want to do this in PowerShell with the command  </p>
  
  <pre><code>New-NetRoute –DestinationPrefix "xxx.xxx.xxx.xxx/yy" –InterfaceIndex w –NextHop zzz.zzz.zzz.zzz
  </code></pre>
  
  <p>The problem here is that <code>InterfaceIndex</code> is mandatory here, but I want the OS to figure this out itself (as it does in the first command). How can I do this?</p>