troubleshooting Question

StreamReader - line of data is displayed on the console

Avatar of H
H asked on
Powershell
2 Comments1 Solution28 ViewsLast Modified:
Hi,

If a csv has column names, I am using the reader to read the first row of data and not the column headers row. I'm using the following statement:

$reader = New-Object System.IO.StreamReader($File)
if ($ColumnNames -eq 'True') {$reader.ReadLine()}

The issue I'm having, is that the line of data is is then displayed on the console. Is there a way to run this statement without having the line displayed?


Thanks,
Helen
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros