Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add-SPOView breaks View Menu #320
After Creating a new List using the SPOList, I use the Add-SPOView to create new views on the List.
The work around is to use the SP Gui Menu to create a New View, based on the one that was created by Add-SPOView. This new view acts correctly.
After adding a view with Add-SPOView Views are not available in the View Menu Control (See attached)
Also if this command is run in a script with multiple other items running before it, we get this error.
If the Command is run in ISE it does not return this error.
Steps to reproduce behavior
What version of the PnP-PowerShell Cmdlets are you using?
Not an answer I am afraid but I have seen the same issue whenever trying to create "GRID" type views. This is apparent not just in the PnP code but also when just trying to use the CSOM to create the grid view "manually" via script. The view is not consistently shown in the quick access area but the view is created correctly if you select the lists "Current View" dropdown options.
Not adding much to this but I'm also having same issue.
I'm executing a bunch of commands to provision a site and build it out. When adding a view it will throw an error. It creates the view like you have but the customer doesn't appreciate seeing the error.
It only happens after I create a new site like below. If the site already exists and I'm just deleting lists and recreating the lists then it works perfectly.
$rootWebUrlParam = "https://tdaly.sharepoint.com/sites/tdaly" $newSiteTitleParam = "test2" $newSiteUrlParam = "test2" Connect-PnPOnline -Url $rootWebUrlParam -Credentials $cred Remove-PnPWeb -Url $newSiteUrlParam -Force New-PnPWeb -Title $newSiteTitleParam -Url $newSiteUrlParam -Template "CMSPUBLISHING#0" -InheritNavigation Connect-PnPOnline -Url $rootWebUrlParam/$newSiteUrlParam -Credentials $cred New-PnPList -Title "Calendar" -Template "Events" -OnQuickLaunch New-PnPList -Title "Announcements" -Template "Announcements" -OnQuickLaunch Add-PnPView -List "Announcements" -Title "Rollup" -Fields "Title","Body","Created" -RowLimit 5 -Query "<OrderBy><FieldRef Name=""Created"" Ascending=""False""/></OrderBy>"`
format-default : The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.
After a LOT of trial and error I've figured out a decent work around.