Monthly Archive

Categories

Its a wrap

When we run a cmdlet such as Get-EventLog we often find that the display is truncated

PS> Get-EventLog -LogName Application | select -First 5

  Index Time          EntryType   Source                 InstanceID Message
   ----- ----          ---------   ------                 ---------- -------
   12961 Jul 31 12:39  Information Com4QLBEx                       0 The description for Event ID '0' in Source 'Com...
   12960 Jul 31 12:39  Information hpqwmiex                        0 The description for Event ID '0' in Source 'hpq...
   12959 Jul 31 12:39  Information Wlclntfy               2147489648 The winlogon notification subscriber <SessionEn...
   12958 Jul 31 12:39  Information Winlogon               1073745925 Windows license validated.
   12957 Jul 31 12:01  Information Windows Error Rep...         1001 Fault bucket , type 0...

If we we need to actually need to see the full information we need to use format-table

PS> Get-EventLog -LogName Application | select -First 2 | Format-Table -Wrap

   Index Time          EntryType   Source                 InstanceID Message
   ----- ----          ---------   ------                 ---------- -------
   12962 Jul 31 12:44  Information HHCTRL                       1904 The description for Event ID '1904' in Source 'HHC
                                                                     TRL' cannot be found.  The local computer may not
                                                                     have the necessary registry information or message
                                                                      DLL files to display the message, or you may not
                                                                     have permission to access them.  The following inf
                                                                     ormation is part of the event:'about:blank', 'http
                                                                     ://go.microsoft.com/fwlink?LinkID=45840'
   12961 Jul 31 12:39  Information Com4QLBEx                       0 The description for Event ID '0' in Source 'Com4QL
                                                                     BEx' cannot be found.  The local computer may not
                                                                     have the necessary registry information or message
                                                                      DLL files to display the message, or you may not
                                                                     have permission to access them.  The following inf
                                                                     ormation is part of the event:'Service started'

The –wrap parameter gives us the capability to display the full data.  This parameter is also available in v1.

Technorati Tags: PowerShell,format

Leave a Reply