# Get-NetConnectionProfile how to use a piped where command?

**URL:** <https://forums.powershell.org/t/get-netconnectionprofile-how-to-use-a-piped-where-command/14479>\
**Category:** PowerShell Help\
**Created:** [June 4, 2020, 11:16am UTC](https://forums.powershell.org/t/get-netconnectionprofile-how-to-use-a-piped-where-command/14479 "2020-06-04T11:16:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ancient](https://avatars.discourse-cdn.com/v4/letter/a/7993a0/32.png) [@ancient](https://forums.powershell.org/u/ancient)\
**Post date:** [June 4, 2020, 11:16am UTC](https://forums.powershell.org/t/get-netconnectionprofile-how-to-use-a-piped-where-command/14479/1 "2020-06-04T11:16:06Z")

</div>

Hi all

Get-NetConnectionProfile

This lists multiple connections.

What command can I use to give me the results for just the below connection ie

if the InterfaceAlias is “Tunnel” and the Name is “[mydomain.uk](http://mydomain.uk)” ?

Name : [mydomain.uk](http://mydomain.uk)  
InterfaceAlias : Tunnel  
InterfaceIndex : 87  
NetworkCategory : DomainAuthenticated  
IPv4Connectivity : Internet  
IPv6Connectivity : NoTraffic

I’ve tried a piped where -match - like -eq, I’m getting the syntax wrong somewhere.

Thanks for any info.

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [June 4, 2020, 2:42pm UTC](https://forums.powershell.org/t/get-netconnectionprofile-how-to-use-a-piped-where-command/14479/2 "2020-06-04T14:42:59Z")

</div>

John

When you post code, error messages, sample data or console output format it as code, please.  
In the “ **Text** ” view you can use the code tags “ **PRE** ”, in the “ **Visual** ” view you can use the format template “ **Preformatted** ”. You can go back edit your post and fix the formatting - you don’t have to create a new one.  
Thanks in advance.

Please take a look at the cmdlet [Where-Object](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/where-object?view=powershell-7). Please read the complete help including the examples to learn how to use it.

If you have problems with your code you should share this code here completely including the error messages you might get.

---

<div class="post-metadata">

**Author:** ![js2010](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@js2010](https://forums.powershell.org/u/js2010)\
**Post date:** [June 4, 2020, 4:17pm UTC](https://forums.powershell.org/t/get-netconnectionprofile-how-to-use-a-piped-where-command/14479/3 "2020-06-04T16:17:29Z")

</div>

With “-and” you have to go the scriptblock form:

```
| where { $_.InterfaceAlias -eq 'Tunnel' -and $_.Name -eq 'mydomain.uk' }
```

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:30pm UTC](https://forums.powershell.org/t/get-netconnectionprofile-how-to-use-a-piped-where-command/14479/4 "2024-05-16T20:30:07Z")

</div>

Closed on May 16, 2024, 8:30pm UTC


