title: Powershell Get Value from PsCustomObject
body: <p>I need some help on this:</p>
  <p>I've got a [pscustomobject] that contains the below results, get from a xml file</p>
  <pre><code>Files                                           Session    
  -----                                           -------    
  {IMG_0518.JPG, IMG_0520.JPG, VG_Overview.mp4, } VG_Overview
  </code></pre>
  <p>I need to get the duplicated values on Files, e get it's respective session value:</p>
  <p>My code to get the duplicated values: $trse is my [pscustomobject]</p>
  <pre><code>  $trse | ForEach-Object {$_.Files.Where({ $_ -ne &quot;&quot;})} | Group | Where-Object{$_.Count -gt 1} | Select @{Name=&quot;Files&quot;;Expression={$_.Name}},@{Name=&quot;Session&quot;;Expression={$_.Session}},@{Name=&quot;Occurrences&quot;;Expression={$_.Count}} 
  </code></pre>
  <p>and the results are this:</p>
  <pre><code>    Files               Session Occurrences
      -----               ------- -----------
      GC7_Gender.WAV                      2
      NG6_Gender.WAV                      2
      NG9_Gender_I.WAV                    2
      NG9_Gender_II.WAV                   2
      VG4_Gender.WAV                      2
  </code></pre>
  <p>And i need to get this:</p>
  <pre><code>    Files               Session Occurrences
      -----               ------- -----------
      GC7_Gender.WAV      VG_Over         2
      NG6_Gender.WAV      Gh_tre          2
      NG9_Gender_I.WAV    FG_iop          2
      NG9_Gender_II.WAV   VB_jkl          2
      VG4_Gender.WAV      ER_uilv         2
  </code></pre>
  <p>Thanks a lot for any help on this, i think the problem is when i get de duplicated files, i lost the session values.</p>