title: How to find specific private endpoint in azure powershell
body: <p>I'm running this command in azure to pull private endpoints associated to a storage account:</p>
  <pre><code>Get-AzPrivateEndpointConnection -privatelinkresourceid /subscriptions/subscriptionID/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountname
  </code></pre>
  <p>It returns results that look like the following:</p>
  <pre><code>Name                              : storageaccountname.93jd9v4a-84d3-942z-9g32-3895820193842
  Id                                : /subscriptions/SubscriptionID/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountname/privateEndp
                                  ointConnections/storageaccountname.93jd9v4a-84d3-942z-9g32-3895820193842
  GroupId                           : 
  ProvisioningState                 : Succeeded
  PrivateEndpoint                   : {
                                    &quot;Id&quot;: &quot;/subscriptions/SubscriptionID/resourceGroups/rgname/providers/Microsoft.Network/privateEndpoints/PE1&quot;
                                  }
  PrivateLinkServiceConnectionState : {
                                    &quot;Status&quot;: &quot;Pending&quot;,
                                    &quot;Description&quot;: &quot;&quot;
                                  }
  LinkIdentifier                    : 
  
  Name                              : storageaccountname.840ar94v-492s-594v-942s-49204816482941a
  Id                                : /subscriptions/subscriptionID/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountname/privateEndp
                                  ointConnections/storageaccountname.840ar94v-492s-594v-942s-49204816482941a
  GroupId                           : 
  ProvisioningState                 : Succeeded
  PrivateEndpoint                   : {
                                    &quot;Id&quot;: &quot;/subscriptions/subscriptionID/resourceGroups/rgname/providers/Microsoft.Network/privateEndpoints/PE2&quot;
                                  }
  PrivateLinkServiceConnectionState : {
                                    &quot;Status&quot;: &quot;Approved&quot;,
                                    &quot;Description&quot;: &quot;2022-05-23: approved&quot;
                                  }
  LinkIdentifier                    : 
  </code></pre>
  <p>I want it to return just the one that has PE2 in the &quot;PrivateEndpoint&quot; parameter, so I run:</p>
  <pre><code>Get-AzPrivateEndpointConnection -privatelinkresourceid /subscriptions/subscriptionID/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountname | where-object privateendpoint -like &quot;*PE2*&quot;
  </code></pre>
  <p>But it doesn't return anything.  If I run...:</p>
  <pre><code>Get-AzPrivateEndpointConnection -privatelinkresourceid /subscriptions/subscriptionID/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountname | where-object privateendpoint -like &quot;*&quot;
  </code></pre>
  <p>...it returns them all.</p>
  <p>How can I use where-object to return just the PrivateEndpoint with PE2?</p>