title: PowerShell: how to count number of rows in csv file?
body: <p>How can I count the number of rows in a csv file using powershell? I tried something like</p>
  
  <pre><code>Get-Content -length "C:\Directory\file.csv"
  </code></pre>
  
  <p>or</p>
  
  <pre><code>(Get-Content).length "C:\Directory\file.csv"
  </code></pre>
  
  <p>but these result an error.</p>