Add-PnPView

Adds a view to a list

Syntax

Add-PnPView
   -List <ListPipeBind>
              -Title <String>
              -Fields <String[]>
              [-Query <String>]
              [-ViewType <ViewType>]
              [-RowLimit <UInt32>]
              [-Personal [<SwitchParameter>]]
              [-SetAsDefault [<SwitchParameter>]]
              [-Paged [<SwitchParameter>]]
              [-Web <WebPipeBind>]
              [-Connection <SPOnlineConnection>]

Examples

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

Add-PnPView -List "Demo List" -Title "Demo View" -Fields "Title","Address"

Adds a view named "Demo view" to the "Demo List" list.

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

Add-PnPView -List "Demo List" -Title "Demo View" -Fields "Title","Address" -Paged

Adds a view named "Demo view" to the "Demo List" list and makes sure there's paging on this view.

Required Parameters

-Fields

A list of fields to add.

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

The ID or Url of the list.

Type:ListPipeBind
Position:0
Accept pipeline input:True
Accept wildcard characters:False
-Title

The title of the view.

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False

Optional 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
-Paged

If specified, the view will have paging.

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

If specified, a personal view will be created.

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

A valid CAML Query.

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-RowLimit

The row limit for the view. Defaults to 30.

Type:UInt32
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-SetAsDefault

If specified, the view will be set as the default view for the list.

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

The type of view to add.

Type:ViewType
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

Outputs

Microsoft.SharePoint.Client.View