Solved

PowerShell Format-Table Width Help

Posted on 2012-04-11
1
1,128 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 68

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

705 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now