Flexible SharePoint Deployment

This blog post is the first in a series on SharePoint deployment without solution packages (wsp). I am working on building a set of custom PowerShell command-lets using the Client-Side Object Model (C#) to automate deployments. For my command-lets I provide a little PowerShell wrapper so you can also use these with SharePoint Solution Deployer (SPSD). Currently the following features and target platforms are supported:

SharePoint 2010 SharePoint 2013 SharePoint Online
Add-SPFile

X

X

X

Add-SPWorkflowDefinition

X

X

Add-SPWorkflowSubscritpion

X

X

Get Started

Download the appropriate version (SharePoint 2010 or SharePoint 2013/Online) from GitHub and import it into your PowerShell session:

    Import-Module .\SPSD.Extensions.Client.dll

Add-SPFile

The command-let deploys a single file or entire folder structure with files to a SharePoint document library. I use this primarily to deploy client-side solutions that consist of a bunch of JavaScript, TypeScript, MAP, CSS and HTML files. But you can also use it to deploy display templates or other stuff to SharePoint.

Here is an example on how to deploy jQuery to the shared documents library on my SharePoint demo site:

Add-SPWorkflowDefinition

This command-let deploys a Workflow Manager Workflow (SharePoint 2013) workflow definition (XAML file) to SharePoint. You can export the XAML file from SharePoint Designer and that way easily deploy the workflow to multiple locations or to your staging environments. The example shows you how to deploy a site workflow. The workflow definition ID is required in the next step to create the subscription for it. You can also deploy list or reusable workflows.

Add-SPWorkflowSubscritpion

This command-let creates a subscription to a list or site for a Workflow Manager Workflow (SharePoint 2013). You need the ID of the workflow definition to do this. When the subscription is enabled you can start the workflow. Here is an example:

In the following blog posts I will dig deeper into all the deployment options of the three command-lets. I will also show how to use them with SharePoint Solution Deployer.

Leave a Reply

Your email address will not be published. Required fields are marked *