Can anyone confirm this bug in CSOM for me? Also if the beautiful people at Microsoft are watching, i'd love for this to be resolved :)
$siteUrl = "" $Username = "" $password = "" [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Publishing") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Publishing.Navigation") | Out-Null $Password = Read-Host "Password for $Username" $SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force $SiteCredential = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $SecurePassword) $context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl) $context.Credentials = $SiteCredential $quickLaunch = $context.Web.Navigation.QuickLaunch; $context.Load($quickLaunch); $context.ExecuteQuery(); $node = $quickLaunch.Item(0) # THROWS ERROR HERE
Throws this error:
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
- Edited by Aron Hardy-Bardsley 1 hour 52 minutes ago