Invoke-PnPWebAction

Executes operations on web, lists and list items.

Syntax

Invoke-PnPWebAction
      [-Webs <Web[]>]
                         [-WebAction <Web>]
                         [-ShouldProcessWebAction <Web>]
                         [-PostWebAction <Web>]
                         [-ShouldProcessPostWebAction <Web>]
                         [-WebProperties <String[]>]
                         [-ListAction <List>]
                         [-ShouldProcessListAction <List>]
                         [-PostListAction <List>]
                         [-ShouldProcessPostListAction <List>]
                         [-ListProperties <String[]>]
                         [-ListItemAction <ListItem>]
                         [-ShouldProcessListItemAction <ListItem>]
                         [-ListItemProperties <String[]>]
                         [-SubWebs [<SwitchParameter>]]
                         [-DisableStatisticsOutput [<SwitchParameter>]]
                         [-SkipCounting [<SwitchParameter>]]
                         [-Web <WebPipeBind>]
                         [-Connection <SPOnlineConnection>]

Examples

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

Invoke-PnPWebAction -ListAction ${function:ListAction}

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

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

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

Parameters

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type:SPOnlineConnection
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-DisableStatisticsOutput

Will not output statistics after the operation

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-ListAction

Function to be executed on the list. There is one input parameter of type List

Type:List
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-ListItemAction

Function to be executed on the list item. There is one input parameter of type ListItem

Type:ListItem
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-ListItemProperties

The properties to load for list items.

Type:String[]
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-ListProperties

The properties to load for list.

Type:String[]
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-PostListAction

Function to be executed on the list, this will trigger after list items have been processed. There is one input parameter of type List

Type:List
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-PostWebAction

Function 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

Type:Web
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-ShouldProcessListAction

Function 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

Type:List
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-ShouldProcessListItemAction

Function 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

Type:ListItem
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-ShouldProcessPostListAction

Function 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

Type:List
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-ShouldProcessPostWebAction

Function 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

Type:Web
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-ShouldProcessWebAction

Function 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

Type:Web
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-SkipCounting

Will skip the counting process; by doing this you will not get an estimated time remaining

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-SubWebs

Specify if sub webs will be processed

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type:WebPipeBind
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-WebAction

Function to be executed on the web. There is one input parameter of type Web

Type:Web
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-WebProperties

The properties to load for web.

Type:String[]
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Webs

Webs you want to process (for example different site collections), will use Web parameter if not specified

Type:Web[]
Position:Named
Accept pipeline input:False
Accept wildcard characters:False