Book Image

SharePoint 2013 WCM Advanced Cookbook

By : JOHN CHAPMAN
Book Image

SharePoint 2013 WCM Advanced Cookbook

By: JOHN CHAPMAN

Overview of this book

Table of Contents (19 chapters)
SharePoint 2013 WCM Advanced Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Importing a design package to all site collections with PowerShell


Applying a design package to a large number of site collections can be a tedious task. To expedite the process, we can use PowerShell. In this recipe, we are going to use a PowerShell script (PS1) to upload and apply a design package to each content site collection in each web application on the local SharePoint farm.

How to do it...

Follow these steps to import a design package to all site collections with PowerShell:

  1. Open your preferred text editor to create the PS1 script file.

  2. Load the Microsoft.SharePoint.dll and Microsoft.SharePoint.Publishing.dll assemblies into the PowerShell session.

    [Reflection.Assembly]::LoadFrom("C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Publishing.dll")
    
    [Reflection.Assembly]::LoadFrom("C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.dll")
    
  3. Specify the path to the design package WSP file and...