title: Exporting results from get-acl to a .csv
body: <p>I am trying to get the following powershell script to output the results into a .csv.  The .csv file is created but there is no data, what am I doing wrong?</p>
  
  <pre><code>$rootfolder = Get-ChildItem -recurse -Path [PATH] | where {$_.Attributes -eq 'Directory'} 
  foreach ($userdir in $rootfolder) { 
  $userdir.FullName 
  get-acl $userdir.FullName | foreach {write-host "The owner is : " $_.Owner -Foregroundcolor Green } | export-csv c:\powershell\test.csv
  Write-Host "`n" 
  } 
  </code></pre>