"Kiron" <Kiron@discussions.microsoft.com> wrote in message
news

1FF3ADA-7974-4805-BFFC-6E668C42DAA4@microsoft.com...
> Thanks for the tip. The [IO.File] Method does get the contents faster but
> I
> suppose the memory overflow issue remains because it would go through the
> pipeline as a big chunk.
> Get-Content's -ReadCount could be set to a higher value than 1 to get
> larger
> chunks of data -therefore faster- without overflowing the memory,
> unfortunately, the comparison operators
> (-like, -notlike, -match, -notmatch)
> don't work efficently then, many lines are skipped, missed or ignored.
>
Even though "get-content -readcount 1000" reads a 1000 lines at a time and
sends them down the pipeline, the next stage of the pipeline still sees each
individual line. So that should not impact operators like -like
and -notlike. This would matter for -match *if* you needed to use
singleline/multiline regex mode in which case you need all the contents as a
single string.
--
Keith