Table of contents
TOC
Collapse the table of content
Expand the table of content

Invoke-PnPWebAction

Bert Jansen|Last Updated: 2/20/2017
|
1 Contributor

Executes operations on web, lists and list items.

Syntax

Invoke-PnPWebAction [-Webs <Web[]>]
                    [-WebAction <Action`1>]
                    [-ShouldProcessWebAction <Func`2>]
                    [-PostWebAction <Action`1>]
                    [-ShouldProcessPostWebAction <Func`2>]
                    [-WebProperties <String[]>]
                    [-ListAction <Action`1>]
                    [-ShouldProcessListAction <Func`2>]
                    [-PostListAction <Action`1>]
                    [-ShouldProcessPostListAction <Func`2>]
                    [-ListProperties <String[]>]
                    [-ListItemAction <Action`1>]
                    [-ShouldProcessListItemAction <Func`2>]
                    [-ListItemProperties <String[]>]
                    [-SubWebs [<SwitchParameter>]]
                    [-DisableStatisticsOutput [<SwitchParameter>]]
                    [-SkipCounting [<SwitchParameter>]]
                    [-Web <WebPipeBind>]

Parameters

ParameterTypeRequiredDescription
DisableStatisticsOutputSwitchParameterFalseWill not output statistics after the operation
ListActionAction`1FalseFunction to be executed on the list. There is one input parameter of type List
ListItemActionAction`1FalseFunction to be executed on the list item. There is one input parameter of type ListItem
ListItemPropertiesString[]FalseThe properties to load for list items.
ListPropertiesString[]FalseThe properties to load for list.
PostListActionAction`1FalseFunction to be executed on the list, this will trigger after list items have been processed. There is one input parameter of type List
PostWebActionAction`1FalseFunction to be executed on the web, this will trigger after lists and list items have been processed. There is one input parameter of type Web
ShouldProcessListActionFunc`2FalseFunction to be executed on the web that would determine if ListAction should be invoked, There is one input parameter of type List and the function should return a boolean value
ShouldProcessListItemActionFunc`2FalseFunction to be executed on the web that would determine if ListItemAction should be invoked, There is one input parameter of type ListItem and the function should return a boolean value
ShouldProcessPostListActionFunc`2FalseFunction to be executed on the web that would determine if PostListAction should be invoked, There is one input parameter of type List and the function should return a boolean value
ShouldProcessPostWebActionFunc`2FalseFunction to be executed on the web that would determine if PostWebAction should be invoked, There is one input parameter of type Web and the function should return a boolean value
ShouldProcessWebActionFunc`2FalseFunction to be executed on the web that would determine if WebAction should be invoked, There is one input parameter of type Web and the function should return a boolean value
SkipCountingSwitchParameterFalseWill skip the counting process; by doing this you will not get an estimated time remaining
SubWebsSwitchParameterFalseSpecify if sub webs will be processed
WebWebPipeBindFalseThe web to apply the command to. Omit this parameter to use the current web.
WebActionAction`1FalseFunction to be executed on the web. There is one input parameter of type Web
WebPropertiesString[]FalseThe properties to load for web.
WebsWeb[]FalseWebs you want to process (for example different site collections), will use Web parameter if not specified

Examples

Example 1

PS:> Invoke-PnPWebAction -ListAction ${function:ListAction}

This will call the function ListAction on all the lists located on the current web.

Example 2

PS:> Invoke-PnPWebAction -ShouldProcessListAction ${function:ShouldProcessList} -ListAction ${function:ListAction}

This will call the function ShouldProcessList, if it returns true the function ListAction will then be called. This will occur on all lists located on the current web

© 2017 Microsoft