Solved

PowerShell Format-Table Width Help

Posted on 2012-04-11
1
1,387 Views
Last Modified: 2012-04-11
I am trying to specify the width of the output table but trying all of the Format-Table properties specifying the width don't seem to work.  Below is the command I am trying to output.  I'm mostly concerned with the Message column.

Get-EventLog -Verbose -log "Application" -EntryType Information -After (Get-Date).Date | Format-Table -AutoSize -Wrap
0
Comment
Question by:jonathanbyers
1 Comment
 
LVL 69

Accepted Solution

by:
Qlemo earned 500 total points
ID: 37833595
-autosize does not work well here. You will indeed have to provide the width of each column here to get a reasonable result. This should get you started, but it only shows two of the columns, so you will need to expand to your needs:
Get-EventLog -Verbose -log "Application" -EntryType Information -After (Get-Date).Date | 
Format-Table -wrap `
  @{label="TimeWritten"; width= 10; e={$_.TimeWritten}},
  @{label="Message"    ; width=100; e={$_.message    }}

Open in new window

0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding a countdown to HTA 12 99
share local drives of a different computer via powershell 1 25
Python to .bat or Powershell 2 33
Script Error 3 18
In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
Set OWA language and time zone in Exchange for individuals, all users or per database.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question