I keep getting this error messeage when I try look at a ViewCollection from a list
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. + CategoryInfo : NotSpecified: (:) [format-default], CollectionNotInitializedException + FullyQualifiedErrorId : Microsoft.SharePoint.Client.CollectionNotInitializedException,Microsoft.PowerShell.Commands.FormatDefaultCommand
I believe my $list.views
object is not being initialized. I have tried the following
$ctx.Load($list)
$ctx.Load($list.views)
$ctx.Load($list, 'Views') <-- incorrect syntax and other variations
I know I need a SP.ClientObject to load into the context before running my ExecuteQuery but the only examples I see are c# code which uses lambda Expressions to load in properties explicitly but I am unaware of how to do the same thing in powershell