Table of Contents
Introduction
This article will address the challenges around automation of SharePoint Online deployment.Below artifacts can be developed through this technique,
- List Definition
- List Instance
- Web part development
- Template Development
- JS Link web part development
- Remote Timer Job
- Remote Event Handler
- etc.
Tool Description
This tool is responsible for activating the mandatory features for any site other than Publishing and Installing or Upgrading the WSP Solution to SPO O365 tenant site collection.Below are the features activated using this tool,
- SharePoint Server Publishing Infrastructure
- SharePoint Server Publishing
You can also extend the logic for activation of other feature by calling below,
PowerShell
Enable-SPOFeature -sSiteColUrl $SiteURL -spoCtx $Context -sFeatureGuid $FeatureGuidServerPublishing -IsSiteScope $False
Use below parameters while calling the method:
-
$SiteURL - site collection URL
-
$Context - Context of the site
-
$sFeatureGuid - Guid of feature to be activated
-
$True or $False - is a site collection level feature
Download Source
Click here to download SourceEnvironment Setup for a remote machine
In order to enable SharePoint Online PowerShell Script execution from your remote machine. Click here for setup stepsAuthentication and Execution Model
As depicted in above model diagram shows how PowerShell based tool help to authenticate, connect to SPO and on validation it helps to execute the CSOM based commandlets and deploy the WSP to perform deployment of different artifacts as packaged. Below is the major component as depicted in the diagram:
- SharePoint Online Management Shell
- Authentication component - while connecting to SharePoint Online tenant
- Validated Admin enable to process the execution of SPO
- SharePoint Tenant - Site Collection Targeted destination for deployment
Run Execution Command
Below is the command will be helpful to execute the tool. Kindly modify the parameters before execution
PowerShell
.\ApplyDesignPackageInstalltionAndUpgradeWSP.ps1 -User admin@xxxxxx.onmicrosoft.com -SiteURL "https://xxxxxx.sharepoint.com/sites/xxxxxx" -wspFullFilePath "C:\Amjad\<WSPBuildName>.wsp" -WspFileName "<WSPBuildName>.wsp" -wspPackageName "<WSPBuildName>" -majorVersion 1 -minorVersion 0
Parameters details are as below.
The script can accept seven parameters from the command line:
- User
- mandatory - Administrator login ID for the tenant we are querying
- SiteURL
- mandatory - Destination Site URL for the tenant we are querying
- wspFullFilePath
- mandatory - Path of WSP location to upload from
- WspFileName
- mandatory - Name of WSP file
- majorVersion
- Optional - majorVersion of the Build deployment or upgrade
- majorVersion
- Optional - minorVersion of the Build deployment or upgrade#