Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

get-content for a one-liner file

$
0
0

Hello,

i am using get-content to build an array of lines of text in a file, for further processing.

this works beautifully, except....

when the file has only one line, the array is not an array of one element having the value of the line of text as I expected. Instead, it appears to be an array of single characters.

Does anyone know if there is a command option that I missed while reading documentation for get-command, or another way to indicate to the use get-content command that I want the single line of text?

i am looping through a folder of text files, so I would like a solution that would treat all the files in the same way.

Thanks,


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>