Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PowerShell Format-Table Width Help

Posted on 2012-04-11
1
Medium Priority
?
1,959 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 71

Accepted Solution

by:
Qlemo earned 2000 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

A procedure for exporting installed hotfix details of remote computers using powershell
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

597 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