Displaying Data

Displaying Data

You can use the Windows PowerShell Select-Object (Select) cmdlet to display simple data types such as Strings and Integers, by listing property names:

Select Url, Owner 

 

Many properties are objects that have their own properties. We need a special notation to retrieve these child properties. For example, a site collection’s quota property is an object and has a property named StorageMaximumLevel. To display this property, enter

Select Url, Owner, {$_.Quota.StorageMaximumLevel

 

Although this works, it produces an ugly column heading, labeled $_.Quota.StorageMaximumLevel.

To display this data with the more attractive column heading Quota, you need to define both the label (i.e., column heading) to display and the expression:

 

@{ label="Quota"; expression={$_.Quota.StorageMaximumLevel} }

 

Return to the main article, "Inventorying SharePoint Using PowerShell."

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish