Solved

PowerShell Format-Table Width Help

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AD Expiration from CSV 4 21
Optimize find and replace on 194 MB text file 20 41
Need some help with powershell script 5 36
Query Computer names and description using dns 14 24
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

920 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