SharePoint Online SPOMod: Set-SPOListView
This article describes a function of a custom SharePoint Online module available for download and installation on GitHub where it welcomes all your suggestions and contributions.
Set-SPOListView
Sets or updates one or more properties' values for a list view.
Parameters
ListName | Mandatory | Mutually exclusive with ListGUID. Name of the list where the views are. |
ListGUID | Mandatory | Mutually exclusive with ListName. GUID of the list where the views are. |
ViewGUID | Mandatory | Mutually exclusive with ViewName. GUID of the view to be updated |
ViewName | Mandatory | Mutually exclusive with ViewGUID. Name of the view to be updated. |
Hidden | Optional | Boolean. |
DefaultView | Optional | Boolean. Defines whether the current view is the default view. |
AggregationsStatus | Optional | String. On/off |
Aggregations | Optional | String. |
DefaultViewForContentType | Optional | Boolean. |
EditorModfied | Optional | Boolean. |
Formats | Optional | String. |
IncludeRootFolder | Optional | Boolean. |
JSLink | Optional | String. |
MobileDefaultView | Optional | Boolean. |
MobileView | Optional | Boolean. |
Paged | Optional | Boolean. |
PersonalView | Optional | Boolean. |
RequiresClientIntegration | Optional | Boolean. |
Threaded | Optional | Boolean. |
RowLimit | Optional | Int. Sets the number of items the view should display per page. |
Examples
----- EXAMPLE 1 ------
Hide a view from the menu and list settings.
Set-SPOListView -ListName MyList1 -ViewName veew2 -Hidden $true
----- EXAMPLE 2 ------
Set a view as default.
Set-SPOListView -ListName MyList1 -ViewName veew2 -DefaultView $true
----- EXAMPLE 3 ------
Set lists to use the same view as default.
$listTitles=(Get-SPOList -IncludeAllProperties | where {$_.Title -cmatch "MyList"}).Title
foreach($list in $listTitles){Set-SPOListView -ListName $list -ViewName "Short Quick OverView" -DefaultView $true}
----- EXAMPLE 4 ------
Set view as a mobile view.
Set-SPOListView -ListName MyList1 -ViewName veew2 -MobileView $true -MobileDefaultView $true
----- EXAMPLE 5 ------
Set the number of items to appear in the view.
Set-SPOListView -ListName MyList1 -ViewName veew -RowLimit 117
See Also
SPOMod Cmdlets and Resources
Connect-SPOCSOM
Get-SPOListView
Remove-SPOListView
New-SPOListView