Add-SPListViewWebPart

Adds an XSLT List View Web Part to the specified web part page.

Add-SPListViewWebPart -Manager <SPLimitedWebPartManagerPipeBind> -Zone <String> [-ZoneIndex [<Int32>]] -List <SPListPipeBind> [-Web [<SPWebPipeBind>]] [-WebPartTitle [<String>]] [-ViewTitle [<String>]] [-Publish [<SwitchParameter>]] [-LinkTitle [<SwitchParameter>]] [-ChromeType [<PartChromeType>]] [-AssignmentCollection [<SPAssignmentCollection>]]

Add-SPListViewWebPart -Manager <SPLimitedWebPartManagerPipeBind> -Row <Int32> -Column <Int32> [-AddSpace [<SwitchParameter>]] -List <SPListPipeBind> [-Web [<SPWebPipeBind>]] [-WebPartTitle [<String>]] [-ViewTitle [<String>]] [-Publish [<SwitchParameter>]] [-LinkTitle [<SwitchParameter>]] [-ChromeType [<PartChromeType>]] [-AssignmentCollection [<SPAssignmentCollection>]]

Add-SPListViewWebPart -File <SPFilePipeBind> -Zone <String> [-ZoneIndex [<Int32>]] -List <SPListPipeBind> [-Web [<SPWebPipeBind>]] [-WebPartTitle [<String>]] [-ViewTitle [<String>]] [-Publish [<SwitchParameter>]] [-LinkTitle [<SwitchParameter>]] [-ChromeType [<PartChromeType>]] [-AssignmentCollection [<SPAssignmentCollection>]]

Add-SPListViewWebPart -File <SPFilePipeBind> -Row <Int32> -Column <Int32> [-AddSpace [<SwitchParameter>]] -List <SPListPipeBind> [-Web [<SPWebPipeBind>]] [-WebPartTitle [<String>]] [-ViewTitle [<String>]] [-Publish [<SwitchParameter>]] [-LinkTitle [<SwitchParameter>]] [-ChromeType [<PartChromeType>]] [-AssignmentCollection [<SPAssignmentCollection>]]

Parameters

1

ParameterRequiredTypeDescription
ManagerTrueSPLimitedWebPartManagerPipeBind

The URL to a web part page or an instance of an SPLimitedWebPartManager object.

ZoneTrueString

The name of the web part zone to add the list view web part to.

ZoneIndexFalseInt32

The index within the web part zone to add the list view web part to.

ListTrueSPListPipeBind

The list to whose view will be added to the page.

The value must be a valid URL in the form http://server_name/lists/listname or /lists/listname. If a server relative URL is provided then the Web parameter must be provided.

WebFalseSPWebPipeBind

Specifies the URL or GUID of the Web containing the list whose view will be added to the page.

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.

WebPartTitleFalseString

The title to set the web part to. The list title will be used if not provided.

ViewTitleFalseString

The name of the view to use for the list view web part.

PublishFalseSwitchParameter

If specified, the page will be published after adding the list view web part.

LinkTitleFalseSwitchParameter

If specified, the web part title will link back to the default view for the list.

ChromeTypeFalsePartChromeType

The chrome settings for the web part.

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
ManagerTrueSPLimitedWebPartManagerPipeBind

The URL to a web part page or an instance of an SPLimitedWebPartManager object.

RowTrueInt32

The zone to add the web part to.

ColumnTrueInt32

The zone index to add the web part to.

AddSpaceFalseSwitchParameter

Add some space before the web part.

ListTrueSPListPipeBind

The list to whose view will be added to the page.

The value must be a valid URL in the form http://server_name/lists/listname or /lists/listname. If a server relative URL is provided then the Web parameter must be provided.

WebFalseSPWebPipeBind

Specifies the URL or GUID of the Web containing the list whose view will be added to the page.

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.

WebPartTitleFalseString

The title to set the web part to. The list title will be used if not provided.

ViewTitleFalseString

The name of the view to use for the list view web part.

PublishFalseSwitchParameter

If specified, the page will be published after adding the list view web part.

LinkTitleFalseSwitchParameter

If specified, the web part title will link back to the default view for the list.

ChromeTypeFalsePartChromeType

The chrome settings for the web part.

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
FileTrueSPFilePipeBind

The URL to a web part page or an instance of an SPFile object.

ZoneTrueString

The name of the web part zone to add the list view web part to.

ZoneIndexFalseInt32

The index within the web part zone to add the list view web part to.

ListTrueSPListPipeBind

The list to whose view will be added to the page.

The value must be a valid URL in the form http://server_name/lists/listname or /lists/listname. If a server relative URL is provided then the Web parameter must be provided.

WebFalseSPWebPipeBind

Specifies the URL or GUID of the Web containing the list whose view will be added to the page.

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.

WebPartTitleFalseString

The title to set the web part to. The list title will be used if not provided.

ViewTitleFalseString

The name of the view to use for the list view web part.

PublishFalseSwitchParameter

If specified, the page will be published after adding the list view web part.

LinkTitleFalseSwitchParameter

If specified, the web part title will link back to the default view for the list.

ChromeTypeFalsePartChromeType

The chrome settings for the web part.

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
FileTrueSPFilePipeBind

The URL to a web part page or an instance of an SPFile object.

RowTrueInt32

The zone to add the web part to.

ColumnTrueInt32

The zone index to add the web part to.

AddSpaceFalseSwitchParameter

Add some space before the web part.

ListTrueSPListPipeBind

The list to whose view will be added to the page.

The value must be a valid URL in the form http://server_name/lists/listname or /lists/listname. If a server relative URL is provided then the Web parameter must be provided.

WebFalseSPWebPipeBind

Specifies the URL or GUID of the Web containing the list whose view will be added to the page.

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.

WebPartTitleFalseString

The title to set the web part to. The list title will be used if not provided.

ViewTitleFalseString

The name of the view to use for the list view web part.

PublishFalseSwitchParameter

If specified, the page will be published after adding the list view web part.

LinkTitleFalseSwitchParameter

If specified, the web part title will link back to the default view for the list.

ChromeTypeFalsePartChromeType

The chrome settings for the web part.

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

Adds an XSLT List View Web Part to the specified web part page.

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:\> Add-SPListViewWebPart -File "http://portal/pages/default.aspx" -List http://portal/Lists/News -WebPartTitle "News" -ViewTitle "All Items" -Zone "Left" -ZoneIndex 0 -Publish

This example adds a news list view web part to the page http://portal/pages/default.aspx.

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

PS C:\> Add-SPListViewWebPart -File "http://portal/sitepages/home.aspx" -List http://portal/Lists/News -WebPartTitle "News" -ViewTitle "All Items" -Row "1" -Column 1 -AddSpace -Publish

This example adds a news list view web part to the wiki page http://portal/sitepages/home.aspx.