Formatting Results

Results retrieved from PowerShell cmdlets are usually displayed in a tabular form but can be further customized by adding the format command. Typical format commands are Format-List, Format-Table, and Format-Wide.

Get-SPSite | Select RootWeb, Url, Owner | Format-Table

The preceding command will list all the site collections and display results in table format. (We selected RootWeb, Url, and Owner properties of site collection to be displayed in the table.)

In addition to formatting results, you can choose a different output destination than a default one (shell screen). One of the useful output destinations is GridView:

Get-SPSolution | Select * | Out-GridView

The preceding command displays all installed SharePoint solutions ...

Get Microsoft SharePoint 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.