Skip to content

Latest commit

 

History

History
183 lines (137 loc) · 3.49 KB

Add-PnPView.md

File metadata and controls

183 lines (137 loc) · 3.49 KB
external help file applicable schema
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online
2.0.0

Add-PnPView

SYNOPSIS

Adds a view to a list

SYNTAX

Add-PnPView -Title <String>
            -Fields <String[]>
            -List <ListPipeBind>
            [-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.

PARAMETERS

-Fields

A list of fields to add.

Type: String[]
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-List

The ID or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Paged

If specified, the view will have paging.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Personal

If specified, a personal view will be created.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Query

A valid CAML Query.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RowLimit

The row limit for the view. Defaults to 30.

Type: UInt32
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SetAsDefault

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

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

The title of the view.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ViewType

The type of view to add.

Type: ViewType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

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

Type: SPOnlineConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: 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
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

RELATED LINKS

SharePoint Developer Patterns and Practices