View Single Post
  #16   Report Post  
Posted to alt.comp.os.windows-10,alt.internet.wireless,sci.electronics.repair
lifewoutmilk lifewoutmilk is offline
external usenet poster
 
Posts: 3
Default Switching between Internet connections WiFi & Ethernet

Bram van den Heuvel wrote on 7/11/2017 11:45 AM:
Given news wrote:

https://technet.microsoft.com/en-us/itpro/powershell/windows/nettcpip/set-netipinterface#example-2-modify-the-interface-metrics

You could change it with a PowerShell, create two scripts, one to prefer
wired, one to prefer wireless.

The PowerShell command to set the metric is:

Set-NetIPInterface -InterfaceIndex INDEX -InterfaceMetric VALUE

To get the INDEX for the adapter, run 'Get-NetAdapter' and look at the
ifIndex column.


I do not understand what a "power shell" is.
I do understand what a "command line" is, so the "netsh" commands working
at a command line make sense to me.

But how do I get to a "power shell command line"?
Googling, I found out I can do this:
Start - Run - powershell
But is that an "admin" power shell?

I really don't understand at all why a second command line even exists.
Can you give me a sentence or two on why I would use powershell over the
command line?


It's more consistent than the command line and related utilities in
Windows for one. Also, instead of manipulating text output, PowerShell
handles objects. So for instance, a pipe command:

Get-NetAdapter | where {$_.Name -eq 'Ethernet'}

Unlike cmd.exe the output from Get-NetAdapter is a list of objects, not
just a bunch of text output. The default output from the above command
would be a table, however, because the output is an object, you can do
something like:

Get-NetAdapter | where {$_.Name -eq 'Ethernet'} | fl

Which gives the same output but in a list format instead. (The 'fl' is
an alias for Format-List.)

Some of Microsoft's own GUI tools are actually running PowerShell behind
the scenes (Active Directory Administration Tool for example). Well
worth learning in my opinion.