July 2011
Intermediate to advanced
480 pages
11h 54m
English
One of the most common PowerShell questions is how to get information returned from commands in the desired output on the screen. In this recipe, we'll take a look at how you can output data from commands and format that information for viewing on the screen.
To change the default output and view the properties of an object in list format, pipe the command to the Format-List cmdlet:
Get-Mailbox testuser | Format-List
To view specific properties in table format, supply a comma-separated list of property names as parameters, as shown next when using Format-Table:
Get-Mailbox testuser | Format-Table name,alias
When you run the Get-Mailbox cmdlet, you only see the Name, Alias, ServerName, and ProhibitSendQuota ...