title: List of folder creation dates in PowerShell
body: <p>I'm so new to this and it's driving me crazy.  I'm trying to get a list of folder creation dates older than 15 years (5475 days) on our file server and export it to Excel.  </p>
  
  <p>I've tried a couple of different methods and came across one I thought was working, but it turns out it just throws <em>all</em> the folder dates into a .csv file lol I realize this code is probably a disaster, so I'm looking for some help.  Much appreciated :)</p>
  
  <pre><code>Function Get-NeglectedFiles {    
      Param([string[]]$path, [int]$numberDays)
  
      $cutOffDate = (Get-Date).AddDays(-$numberDays)
  
      Get-ChildItem -Recurse -Path $path
      Where-Object { $_.CreationTime -le $cutOffDate -and { $_.Attributes -eq 'Directory' } }
  }
  
  Get-NeglectedFiles -path "S:\Test" -numberDays 2000 |
      Select-Object FullName, CreationTime |
      Export-Csv -Path C:\Scripts\Test.csv -NoTypeInformation
  </code></pre>