Publish-SPListItems

Publish any draft or pending items.

Publish-SPListItems [-TakeOverFilesWithNoCheckIn [<SwitchParameter>]] [-FilterExpression [<String>]] -List <SPListPipeBind> [-LogFile [<String>]] [-Comment [<String>]] [-AssignmentCollection [<SPAssignmentCollection>]]

Publish-SPListItems [-TakeOverFilesWithNoCheckIn [<SwitchParameter>]] [-FilterExpression [<String>]] -Web <SPWebPipeBind> [-LogFile [<String>]] [-Comment [<String>]] [-AssignmentCollection [<SPAssignmentCollection>]]

Publish-SPListItems [-TakeOverFilesWithNoCheckIn [<SwitchParameter>]] [-FilterExpression [<String>]] -Site <SPSitePipeBind> [-LogFile [<String>]] [-Comment [<String>]] [-AssignmentCollection [<SPAssignmentCollection>]]

Publish-SPListItems [-TakeOverFilesWithNoCheckIn [<SwitchParameter>]] [-FilterExpression [<String>]] -WebApplication <SPWebApplicationPipeBind> [-LogFile [<String>]] [-Comment [<String>]] [-AssignmentCollection [<SPAssignmentCollection>]]

Publish-SPListItems [-TakeOverFilesWithNoCheckIn [<SwitchParameter>]] [-FilterExpression [<String>]] -Farm <SPFarmPipeBind> [-LogFile [<String>]] [-Comment [<String>]] [-AssignmentCollection [<SPAssignmentCollection>]]

Publish-SPListItems -ListItem <SPListItemPipeBind> [-ParentList [<SPListPipeBind>]] [-LogFile [<String>]] [-Comment [<String>]] [-AssignmentCollection [<SPAssignmentCollection>]]

Parameters

1

ParameterRequiredTypeDescription
TakeOverFilesWithNoCheckInFalseSwitchParameter

Take over ownership of any files that do not have an existing check-in.

FilterExpressionFalseString

A regular expression to match against the file name. For example, to only publish Word and Excel files use the following expression: "\.((docx)|(xlsx))$". If specified, list items are ignored (only files are published).

ListTrueSPListPipeBind

The list containing the items to publish.

LogFileFalseString

The filename to save all details to.

CommentFalseString

A comment to associated with each checked in, published, and approved item.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

2

ParameterRequiredTypeDescription
TakeOverFilesWithNoCheckInFalseSwitchParameter

Take over ownership of any files that do not have an existing check-in.

FilterExpressionFalseString

A regular expression to match against the file name. For example, to only publish Word and Excel files use the following expression: "\.((docx)|(xlsx))$". If specified, list items are ignored (only files are published).

WebTrueSPWebPipeBind

Specifies the URL or GUID of the Web containing the list items to publish.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of Microsoft SharePoint Foundation 2010 Web site (for example, MySPSite1); or an instance of a valid SPWeb object.

LogFileFalseString

The filename to save all details to.

CommentFalseString

A comment to associated with each checked in, published, and approved item.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

3

ParameterRequiredTypeDescription
TakeOverFilesWithNoCheckInFalseSwitchParameter

Take over ownership of any files that do not have an existing check-in.

FilterExpressionFalseString

A regular expression to match against the file name. For example, to only publish Word and Excel files use the following expression: "\.((docx)|(xlsx))$". If specified, list items are ignored (only files are published).

SiteTrueSPSitePipeBind

The site containing the list items to publish.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid URL, in the form http://server_name; or an instance of a valid SPSite object.

LogFileFalseString

The filename to save all details to.

CommentFalseString

A comment to associated with each checked in, published, and approved item.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

4

ParameterRequiredTypeDescription
TakeOverFilesWithNoCheckInFalseSwitchParameter

Take over ownership of any files that do not have an existing check-in.

FilterExpressionFalseString

A regular expression to match against the file name. For example, to only publish Word and Excel files use the following expression: "\.((docx)|(xlsx))$". If specified, list items are ignored (only files are published).

WebApplicationTrueSPWebApplicationPipeBind

The web application containing the list items to publish.

The type must be a valid URL, in the form http://server_name; or an instance of a valid SPWebApplication object.

LogFileFalseString

The filename to save all details to.

CommentFalseString

A comment to associated with each checked in, published, and approved item.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

5

ParameterRequiredTypeDescription
TakeOverFilesWithNoCheckInFalseSwitchParameter

Take over ownership of any files that do not have an existing check-in.

FilterExpressionFalseString

A regular expression to match against the file name. For example, to only publish Word and Excel files use the following expression: "\.((docx)|(xlsx))$". If specified, list items are ignored (only files are published).

FarmTrueSPFarmPipeBind

A valid SPFarm object. All items in the farm will be published.

LogFileFalseString

The filename to save all details to.

CommentFalseString

A comment to associated with each checked in, published, and approved item.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

6

ParameterRequiredTypeDescription
ListItemTrueSPListItemPipeBind

The list item to publish.

ParentListFalseSPListPipeBind

The list containing the item to publish.

LogFileFalseString

The filename to save all details to.

CommentFalseString

A comment to associated with each checked in, published, and approved item.

AssignmentCollectionFalseSPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

Publish any draft or pending items.

Copyright 2016 Falchion Consulting, LLC

> For more information on this cmdlet and others:

> http://blog.falchionconsulting.com/

> Use of this cmdlet is at your own risk.

> Gary Lapointe assumes no liability.

Examples

------------------EXAMPLE 1-----------------------

PS C:\> Get-SPList "http://server_name/pages" | Publish-SPListItems -ListItem 1

This example publishes item with ID 1 in the pages library located at http://server_name.

------------------EXAMPLE 2-----------------------

PS C:\> Publish-SPListItems -ListItem "http://server_name/pages/default.aspx"

This example publishes http://server_name/pages/default.aspx.

------------------EXAMPLE 3-----------------------

PS C:\> Get-SPList "http://server_name/pages" | Publish-SPListItems

This example publishes all items in the pages library located at http://server_name.

------------------EXAMPLE 4-----------------------

PS C:\> Get-SPWeb "http://server_name/" | Publish-SPListItems

This example publishes all items in the web located at http://server_name. This will no recurse through sub-webs.

------------------EXAMPLE 5-----------------------

PS C:\> Get-SPSite "http://server_name/" | Publish-SPListItems

This example publishes all items in the site located at http://server_name. This will recurse through sub-webs.

------------------EXAMPLE 6-----------------------

PS C:\> Get-SPWebApplication "http://server_name/" | Publish-SPListItems

This example publishes all items in the web application located at http://server_name. This will recurse through all sites and sub-webs.

------------------EXAMPLE 7-----------------------

PS C:\> Get-SPFarm | Publish-SPListItems

This example publishes all items in the farm. This will recurse through all web applications, sites, and sub-webs.