title: How to read a CSV file but exclude certain columns containing blanks using Get-Content
body: <p>I want to read a CSV file and exclude rows where dynamically selected columns contain blanks but not all rows of those dynamically selected columns contain blanks.</p>
  
  <p>Trying to use the where clause in the statement below (but not working):</p>
  
  <pre><code>Get-Content $Source -ReadCount 1000 |
    Where {
      ForEach($NotEqualBlankCol in $BlankColumns)
      {
        $NotEqualBlankCol -ne $null -and $NotEqualBlankCol -ne ''}
      } |
        ConvertFrom-Csv |
          Sort-Object -Property $SortByColNames.Replace('"', '') -Unique |
            .
            .
            .
              | Out-File $Destination
  </code></pre>
  
  <p>$BlankColumns is my dynamic object string array which I would like to loop through containing the column names of the CSV that are blank. it can be 1 column or more. When more then all of the selected columns need to be blank to qualify as a row that does not need to be included in the final CSV file output.</p>
  
  <p>How do I do it using Get-Content? Any help would be appreciated.</p>