title: Invoke-Command from powershell v3 to powershell v2
body: <p>I have 2 systems. One of them has PowerShell version 2 and the other has PowerShell version 3. I used Invoke-command from system has version 3 to system has version 2. My output isn't correct. When I use my command in system with PowerShell 2 locally my output has 200 rows but in remotely has 150 rows. Why does it happen?</p>
  
  <pre><code>$log | ForEach-Object{
      get-eventlog -log  $_ -After $yesterday -Before $todaye |
          Group-Object EventID, EntryType, Source, MachineName,
              {(([String]$_.TimeGenerated) -split " ")[0]},
              {(([String]$_.TimeGenerated) -split " ")[1]} -NoElement |
          Select-Object count, name |
          ForEach-Object {
              $properties = @{
                  'ServerName' = ($_.Name -split ", ")[3];
                  'day'        = (($_.Name -split ", ")[4] -split " ")[0];
                  'time'       = (($_.Name -split ", ")[5]);
                  'EventID'    = ($_.Name -split ", ")[0];
                  'EventType'  = ($_.Name -split ", ")[1];
                  'Source'     = ($_.Name -split ", ")[2];
                  'Count'      = $_.Count;
              }
              $psobject = new-object psobject -Property $properties
              $csv += $psobject
          }
  }
  </code></pre>