title: Join/merge arrays' properties
body: <p>I have 2 objects that I will like to merge, but it seems I cannot find the solution</p>
  
  <pre><code>Messages                                   Name                                                                           Error
  --------                                   ----                                                                           -----
  {\\APPS-EUAUTO1\C$\Users\xautosqa\AppDa... test 1                                                                          True
  {[APPS-EUAUTO1] [prep] Setting agent op... test 2                                                                         False
  
  TestPlan        Script          TestCase        TestData        ErrorCount      ErrorText       DateTime        Elapsed        
  --------        ------          --------        --------        ----------      ---------       --------        -------        
  D:\XHostMach... D:\XHostMach... rt1             1,\a\""         1               [#ERROR#][AP... 2014-03-28 1... 0:00:18        
  D:\XHostMach... D:\XHostMach... rt2             1,\a\""         0                               2014-03-28 1... 0:00:08      
  </code></pre>
  
  <p>I have  tried :</p>
  
  <pre><code> function Join-Object {
      Param(
         [Parameter(Position=0)]
         $First
      ,
         [Parameter(Position=1,ValueFromPipeline=$true)]
         $Second
      )
      BEGIN {
         [string[]] $p1 = $First | gm -type Properties | select -expand Name
      }
      Process {
         $Output = $First | Select $p1
         foreach($p in $Second | gm -type Properties | Where { $p1 -notcontains $_.Name } | select -expand Name) {
            Add-Member -in $Output -type NoteProperty -name $p -value $Second."$p"
         }
         $Output
      }
   } # End: Function Join-Object
  
  $TestCases = Join-Object $TxtTestcases $RexTestcases | Select Name, TestPlan, TestCase, Script, TestData, Error, ErrorCount, ErrorText, Messages, DateTime, Elapsed
  </code></pre>
  
  <p>but the second object is not present :</p>
  
  <pre><code>Name         TestPlan     TestCase     Script       TestData            Error ErrorCount   ErrorText    Messages    DateTime   
  ----         --------     --------     ------       --------            ----- ----------   ---------    --------    --------   
  test 1                                                                   True                           {\\APPS-...            
  test 2                                                                  False                           {[APPS-E...            
  </code></pre>
  
  <p>I have also tried :</p>
  
  <pre><code>Function Merge-Testcase {
  Param ($TxtTestcase, $RexTestcase)
      $Fields = @{            
          Name        = $TxtTestcase.Name
          TestPlan    = $RexTestcase.TestPlan
          TestCase    = $RexTestcase.TestCase
          Script      = $RexTestcase.Script
          TestData    = $RexTestcase.TestData
          IsError     = $TxtTestcase.Error
          ErrourCount = $RexTestcase.ErrorCount
          ErrorText   = $RexTestcase.ErrorText
          Messages    = $TxtTestcase.Messages
          DateTime    = $RexTestcase.DateTime
          Elapsed     = $RexTestcase.Elapsed
      }
      New-Object PSObject -Property $Fields | ConvertTo-Csv -NoTypeInformation
  } # End: Function Merge-Testcase
  $TestCases = Merge-Testcase -TxtTestcase $TxtTestcases -RexTestcas $RexTestcase
  $TestCases | Format-Table
  </code></pre>
  
  <p>but I am getting this</p>
  
  <pre><code>"Script","Name","TestCase","TestPlan","ErrorText","TestData","ErrourCount","IsError","Elapsed","DateTime","Messages"
  ,,,,,,,,,,
  </code></pre>
  
  <p>Any idea on how to join the 2 objects ?</p>