SharePoint Online SPOMod: New-SPOListView
This article describes a function of a custom SharePoint Online module available for download and installation at GitHub.
New-SPOListView
Creates a list view.
Parameters
ListName | Mandatory | Mutually exclusive with ListGUID. Name of the list. |
ListGUID | Mandatory | Mutually exclusive with ListName. GUID of the list. |
ViewName | Mandatory | Name of the view to be created. |
ViewQuery | Optional | |
ViewFields | Optional | Array. Defines the columns visible in the view. |
RowLimit | Optional | Int. Sets the number of items the view should be displayed per page. |
Examples
----- EXAMPLE 1 ------
Create a list view with default settings.
New-SPOListView -ListName MyList1 -ViewName Viewek
----- EXAMPLE 2 ------
Create a list view with specific fields.
$fields=@("ID", "Title", "Modified")
New-SPOListView -ListName MyList1 -ViewName Viewek22 -ViewFields $fields -RowLimit 14
----- EXAMPLE 3 ------
Create a list view in several lists.
$fields=@("ID", "Title", "Modified")
$titels=(Get-SPOList -IncludeAllProperties | where {$_.Title -cmatch "MyList"}).Title
foreach($titel in $titels){New-SPOListView -ListName $titel -ViewName "Short Quick OverView" -ViewFields $fields -RowLimit 5}
See Also
SPOMod Cmdlets and Resources
Connect-SPOCSOM
Get-SPOListView
PowershellScripts @ GitHub