Select-String in Powershell only displaying part of the line from a text file, need it to display whole thing

Viewed 13681

I am trying to write a simple PS script to check large .txt log files for a short string: "SRVE0242I:"

$lines = Select-String -Path $logDir -Pattern "SRVE0242I:" | Select-Object line | Out-String

On output though, it only displays the following:

Line
[28/06/17 13:48:27:839] 00000020 ServletWrappe I SRVE0242I: [User] [User] [com_xxxxxxx_...

And not the full line. Is there a limit to how many characters this pulls? I can't find any info on any restrictions for the Select-String cmdlet. Is there a better way to do this so that I don't a) pull the heading "Line" in my list of lines (Don't really want to create table formatting for such a simple output) and b) get the whole line when I pull the info?

2 Answers
Related