Prerequisites:
SharePoint Online Management Shell: https://www.microsoft.com/en-us/download/details.aspx?id=35588
PnP – PowerShell Cmdlets: https://github.com/officedev/pnp-powershell/releases
PowerShell Script:
Open SharePoint Online Management Shell and execute the following script.
- ## Connects to a SharePoint Site
- Connect-SPOnline -Url https:
-
- ## Syntax: Add-SPOView -Title <String> [-Query <String>] -Fields <String[]> [-ViewType <ViewType>] [-RowLimit <UInt32>] [-Personal [<SwitchParameter>]] [-SetAsDefault [<SwitchParameter>]] [-Paged [<SwitchParameter>]] [-Web <WebPipeBind>] -List <ListPipeBind>
- ## Add a view to the list
- Add-SPOView -List "Custom" -Title "My Test View" -Fields "Title","Modified"
-
- ##Disconnects the context
- Disconnect-SPOnline