PowerShell

PowerShell: Using Format-Wide

When it comes to formatting Format-Table and Format-List are the tools Nr. 1. But what about format-wide? The longer I am playing with it the better I like it. Format-Wide is cool!

Format-Wide formats objects as a wide table. Only one property is displayed.

Get-Process | Format-Wide

6.PNG

The parameter column determines the number of columns.

Get-Service | Format-Wide -Column 5

7.PNG

The next command displays all services beginning with letters R-S. Then the ouput is sorted and grouped by Status.

Get-Service [r-s]* | Sort-Object Status | Format-Wide -GroupBy Status

8.PNG

Have fun formatting your output!

Categories: PowerShell

Tagged as: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.