get-sqlerrorlog column width for description

Apr 27, 2012 at 7:00 PM

the column width for the description returned by get-sqlerrorlog is not wide enough.  appears to be 32 characters.

Coordinator
Apr 27, 2012 at 8:39 PM

Do you mean the output the screen? This controlled by the formatting rules in Powershell. You can expand the output on the screen by using the format-* or select-object commands.  See help format-table or help format-list.

A simple command using select-object do so:

get-sqlerrorlog SQL11 | select-object *

You can also see that the Text property (i.e. message) is much larger than 32 by running this command:

Get-SqlErrorLog sql11 | select Text, @{n='size';e={$_.Text.length}}

If you're new to Powershell, a good book learn from is "Learn Windows Powershell In a Month of Lunches"