To read in a text file and skip blank lines, try this:
$file = 'c:\sometextfile.txt' Get-Content $file | Where-Object { $_.Trim() -ne '' }
It will omit empty lines, lines with only blanks and lines with only tabs.
To read in a text file and skip blank lines, try this:
$file = 'c:\sometextfile.txt' Get-Content $file | Where-Object { $_.Trim() -ne '' }
It will omit empty lines, lines with only blanks and lines with only tabs.