And on the tone of my previous post--no time to start like the present! First we should start on SharePoint PowerShell "101". As announced at SPC, we have over 500 cmdets (and even more if you include FAST and PerformancePoint)--but no need to get started memorizing all those; PowerShell offers great "discovery" tools.
Below are some basic samples to get everyone started. Please note that i'm going to skip some "basic" PowerShell concepts (like "Piping") as there is some great information on the web about these; however, some of these first few posts will be "repeat" for PowerShell regulars.
(Note all these commands assume that you have started your PowerShell in the "SharePoint Management Shell" shown below)
1. This command will return all SharePoint cmdlets available on the local farm:
PS> Get-Command -pssnapin Microsoft.SharePoint.PowerShell
2. This command will get help for the given command (we have "beta" documentation for over 90% of our commands!):
PS> Get-Help Get-SPSite
3. We can even get a set of Examples from cmdlet help:
PS> Get-Help Get-SPSite -Examples
4. This command will give you a list of all the "Service" related cmdlets in the local SharePoint install:
PS> Get-Command -noun "SPService*" | Sort Noun
5. This command will simplify #3 by only showing the unique "objects" (aka. Nouns) that are available in PowerShell:
PS> Get-Command -noun "SPService*" | Sort Noun | Select Noun -Unique
6. Need to figure out what properties or methods a .NET SharePoint object has on it? Instead of MSDN, try:
PS> Get-SPSite http://webapplication | Get-Member
That’s all for now! More demos—from the simple to the most advanced—coming soon!