Monday, May 6, 2013

PowerShell for SharePoint Command Builder

The PowerShell for SharePoint Command Builder site has been around for a while now, since about November of 2012, but its an amazing tool that a lot of SharePoint folks don't know about.  The site is a single page HTML5 application designed to help you build PowerShell commands on the fly.  The page is broken into two categories, verbs and nouns.  Simply choose you verb, the choose your noun and you're on your way to building a PowerShell command for SharePoint.

So let's say we need to add a Farm solution.  We'll choose "Add" from the verbs section.  Instantly the "Nouns" section is filtered to what we can add, how about that.

Clicking the "Send" button in the "Verbs" section adds the verb to the Design Surface.  Now, click "Farm Solution" in the "Nouns" section and click "Send".

Now the Design Surface has our verb and noun, and some code is already generated.

You can see in the bottom pane the "Add-SPSolution" command is starting to form.  There is also a link to the MSDN content for the command which is great.  Let's fill the remaining information.  We'll add the "Solution Path" and the command will be updated.

And that's it!  We can click "Copy to Clipboard" to save the command and paste into PowerShell.  Clicking the "Clear Design Surface" will remove everything you've selected and put the page back into its starting point.

At the top of the page there are two dropdowns.  One provides options for your specific SharePoint environment.  The other provides quick pre-built commands you can pull up on demand.

This is a great page to help you build out your PowerShell commands.  If you're like me, you remember most of the ones you need, but there is no way you can remember every command along with its parameters.  This site provides a quick way to view all the commands and get links to MSDN, its invaluable as a SharePoint tool.


No comments:

Post a Comment