Udostępnij za pośrednictwem


PowerShell Cmdlets in SharePoint 2010

You may have already heard that SharePoint 2010 will ship with a PowerShell provider that contains over 500 cmdlets for you to administer SharePoint. The killer though, is that these commandlets can be executed remotely with PowerShell 2.0 WinRM.  Awesome!  Don’t worry about STSADM, it will still be around to support existing administration scripts and utilities. 

You can load the PowerShell provider by typing:

add-pssnapin Microsoft.SharePoint.PowerShell

Much of what Christian (iLoveSharePoint) and I have worked on in SPoshMod for SharePoint 2007 supports the same pattern as the 2010 provider.  Verb-Noun, with SP prefix.   Get-SPSite, Get-SPWeb, etc.

What you may not know is that developers can add custom providers and deploy them to SharePoint.  You can do this by using the Microsoft.SharePoint.PowerShell  namespace.  To distinguish a normal PowerShell cmdlet from a SharePoint cmdlet, an new abstract class has been added to the namespace called: SPCmdlet  (other cmdlets inherit directly from PSCmdlet).

More to come on this topic…