Reputation: 31
I am attempting to use ifIndex result for a specific network adapter in another powershell command. How would I create a line to pull that specific adapter's ifIndex?
Upvotes: 0
Views: 3901
Reputation: 11
The following code will get your adapter and select the IfIndex
property
(get-netadapter -name "AdapterNameHere").IfIndex
Upvotes: 1
Reputation: 3459
Probably something like this:
$ifIndexVariable = Get-NetAdapter -Name 'Specific Adapter Name' | Select-Object -ExpandProperty 'ifIndex'
Upvotes: 1