1             Introduction

Publishing script for SharePoint 2010 automates the publishing, approving of SharePoint contents like pages, xsl sheets and everything that is residing inside a document library with versioning and content approval enabled. Generally, in a SharePoint 2010 WCM development project, multiple items get checked out during development. Towards, the end of the project during deployment, the developer or tester has to manually find all the unpublished items. Checking in these items and approving those manually is a time consuming task. This script automates these all manual steps. You can use this script for “bulk publishing” of multiple documents on SharePoint 2010.

2             Features

Following is the list of features provided by the tool

3             Prerequisites

4             Installation Instructions

For installing this script on your local machine follow these instructions

4.1             Sample Commands

.\PublishSContent.ps1 –Url “http://yoursite” –Recursive $true

.\PublishSContent.ps1 –Url “http://yoursite/subsite” –Recursive $true

.\PublishSContent.ps1 –Url “http://yoursite/subsite” –Recursive $true –Extension “.aspx”

.\PublishSContent.ps1 –Url “http://yoursite” –Recursive $true –Comment “My Approval”

.\PublishSContent.ps1 –Url “http://yoursite/subsite” –Recursive $true –ApproveFolders $false

5             Command line parameters

5.1             “-Url”

Type

Description

Category

Required Parameter

Value

Url of Site collection or sub site

Format

String

Default Value

N.A.

5.2             “-Extension”

Type

Description

Category

Optional Parameter

Value

Extension of files to be approved (e.g “.aspx”)

Format

String

Default Value

“.*”

5.3             “-Comment”

Type

Description

Category

Optional Parameter

Value

Comment for checking in/publishing file

Format

String

Default Value

“System Approval”

5.4             “-ApproveFolders”

Type

Description

Category

Optional Parameter

Value

True or False based upon the requirement

Format

Boolean

Default Value

$true

5.5             “-Recursive”

Type

Description

Category

Optional Parameter

Value

True if you want to recursively publish contents of current site and all subsites

Format

Boolean

Default Value

$false

6             Troubleshooting