Solved

PowerShell Format-Table Width Help

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

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

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…
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

815 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

12 Experts available now in Live!

Get 1:1 Help Now