title: Powershell create a comma delimited list from array of IP's that occur $N number of times
body: <p>Everywhere I have looked has shown me methods of doing this that work with physical files but, for whatever reason, not with an array. I would rather not have this data stored, then called from a file and just work directly with the array if that is possible. I am stuck using PowerShell v2 but this should still be doable. I appreciate any and all help in advance.</p>
  
  <p>I have an array called <code>$net_final</code> that has the following values:</p>
  
  <pre><code>63.232.3.102
  63.232.3.102
  64.339.161.5
  64.339.161.5
  64.339.161.5
  64.339.161.5
  64.339.161.5
  64.339.161.5
  19.19.19.19
  19.19.19.19
  19.19.19.19
  19.19.19.19
  19.19.19.19
  19.19.19.19
  19.19.19.19
  63.339.161.7
  63.339.161.7
  63.339.161.7
  63.339.161.7
  63.339.161.7
  </code></pre>
  
  <p>I then do the following to get a list of IP's that occur 5 or more times in this array:</p>
  
  <p><code>($net_final | Group-Object | Where-Object {$_.Count -ge 5} | 
  Format-Table -HideTableHeaders -Property Name | Out-String).Trim()</code></p>
  
  <p>Which gets me this output:</p>
  
  <pre><code>64.339.161.5
  19.19.19.19
  63.339.161.7
  </code></pre>
  
  <p>However I cannot seem to get them comma delimited on the same line. Making a comma delimited list out of just the array is fairly uncomplicated with things like <code>$net_final -Join ","</code> and <code>($net_final | Select-Object -Unique) -Join ","</code>, but I need to grab array items that occur $N number of times. </p>
  
  <p><strong>Expected output</strong>:</p>
  
  <p><code>64.339.161.5,19.19.19.19,63.339.161.7</code></p>