Find The PowerShell Command You Were Looking For

September 15 2010 2 comments

PowerShell might be a new beast for many SharePoint administrators. Microsoft has been helpful by providing hundreds of commandlets with SharePoint 2010. However, when the commandlets have names such as Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance, remembering the correct commandlet can in many cases be impossible. Using tab key for autofill  is not very usefu, considering the commandlet naming conventions.

Luckily the PowerShell basics are here to help you. One of the most helpful commandlets is Get-Command. For example to get all commandlets related to enterprise search, just type

Get-Command *enterprisesearch*

To just display the command names, format it:

Get-Command *enterprisesearch* | select Name

To get all the commands with noun SPWeb, type

Get-Command -noun SPWeb

To get help how to use a certain commandlet, use the Get-Help commandlet

Get-Help Get-SPWeb -full

Popularity: 1% [?]

2 comments to “Find The PowerShell Command You Were Looking For”

  1. Lauri Peltonen says:

    And if you’re lazy, the shortcut for Get-Command is gcm!

  2. Btw, today we have released new version of HarePoint Workflow Extensions. This product is a set of about 200 new Sharepoint workflow actions and conditions.

    In the new version we add the activity to execute PowerShell scripts directly form workflows.

    It is commercial product, but fully functional version is available for free download at http://www.harepoint.com and it contains about 30 “freeware” activities.

    WBR, Alexander

Leave a Reply