Creating List Items On-the-Fly

When building demonstration and presentation sites, a function that might come in handy is the PowerShell function for creating items in a list. The following sample shows how you could build such a function. It creates a list item in a custom list and assigns only a title for the list item, but it could be extended to create more complex items:

image

You can use the preceding function by typing the following:

image

The preceding code creates three new items (John White, Ann Green, Zoey Gray) in the list "The Team" located on ...

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.