views:

437

answers:

2

When using powershell to retrieve info about events Message column gets trimmed and is too short:

Index Time Type Source EventID Message
----- ---- ---- ------ ------- -------
2 Sep 18 12:50 Info yaddayadda 0 Class: Controllers.BasketController...
1 Sep 18 12:50 Info yaddayadda 0 Class: Controllers.BasketController...

Is it possible to see full message?

+2  A: 

You are seeing the default table format for the type (this will be define in one of the install (x.format.ps1.xml files).

You can:

  • Use a wider console window, the final column fills the available space.
  • Add format-table -wrap to the end of pipeline and PSH will wrap the text of the final column.
  • Add format-table -auto to the end of the pipeline and PSH will adjust all the columns to fit (but needs to see all the data first, so you will not get incremental results).
  • Use both -auto and -wrap.
  • Specify the table format you want. Specify a list of properties to display. Or a list of hashes defining the columns (in this case each can have its own label, alignment, width and expression). See help format-table -full for details.
Richard
"get-eventlog -logname Foo format-table -auto -wrap" did exactly what i needed. Thanks a lot. :)
Arnis L.
+1  A: 

Pipe to Format-List.

Shay Levy
Thanks. That one works too.
Arnis L.