title: Unable to export my data to a CSV
body: <p>I have some data I am trying to push out to a CSV but it keeps failing.  Any advice?</p>
  
  <pre><code>Import-Module ActiveDirectory
  
  $ExportFile = "C:\T2\Test.csv"
  
  $MacHeading = "Mac OS: "
  $MACOS = Get-ADComputer -Filter 'OperatingSystem -like "MAC*"' -Properties OperatingSystem, CanonicalName | Select Name, CanonicalName, OperatingSystem
  $MACOSCount = Get-ADComputer -Filter 'OperatingSystem -like "MAC*"' | Measure-Object | %{$_.Count}
  
  $MacHeading | Export-CSV -path $ExportFile -Append
  $MACOS | Export-CSV -path $ExportFile -Append
  $MACOSCount | Export-CSV -path $ExportFile -Append
  </code></pre>
  
  <p>My error message is:  </p>
  
  <blockquote>
    <p>Export-CSV : Cannot append CSV content to the following file:
    C:\T2\Test.csv. The appended object does not have a property that
    corresponds to the following column: Mac OS: . To continue with
    mismatched properties, add the -Force parameter, and then retry  the
    command. At C:\T2\Test.ps1:9 char:15
    + $MacHeading | Export-CSV -path $ExportFile -Append
    +               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidData: (Mac OS: :String) [Export-Csv], InvalidOperationException
        + FullyQualifiedErrorId : CannotAppendCsvWithMismatchedPropertyNames,Microsoft.PowerShell.Commands.ExportCsvCommand</p>
  </blockquote>