title: Powershell Get-Content -ReadCount Pass Value
body: <p>I have pipe delimited files that I'm trying to search through and want to know if the value in the 8th column is greater than 0. If it is not greater than 0, I want to check another file location. I am running into an issue passing the variable to the if statement. Here is what I have so far: </p>
  
  <pre><code>$file = Get-Content Test.txt -Delimiter '|' -read 8
  $fields = $file[0].psobject.properties | %{$_.name}
  $file | select $fields[2,4,5] 
  </code></pre>
  
  <p>I receive the following output: </p>
  
  <pre><code>PSChildName                                                                                                                                                      ReadCount                                                                               Count 
  Test.txt                                                                                                                                                          8                                                                                     8
  Test.txt                                                                                                                                                            12                                                                                     4
  </code></pre>
  
  <p>I receive the ReadCount I want, 8, but for some reason it also returns 12. How am I able to pass the value for Count value of 8 and continue to an if statement?</p>
  
  <p>Thank you!</p>