title: Count records in csv file - Powershell
body: <p>I have following PS script to get a count. Is there a way to count (minus the header) without importing the entire csv? Sometimes the csv file is very large and sometime it has no records.</p>
  
  <pre><code>Get-ChildItem 'C:\Temp\*.csv' | ForEach {
      $check = Import-Csv $_
      If ($check) { Write-Host "$($_.FullName) contains data" }
      Else { Write-Host "$($_.FullName) does not contain data" }
  }
  </code></pre>