Bug in CSOM? Navigation

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
 


May 28th, 2015 1:47am

Hi

did you initialize  $siteUrl = ""  i am not seeing any such assignment.and try do debug in browser check your quick launch have any items. 

before removing check if collection has any items else it will throw an

Free Windows Admin Tool Kit Click here and download it now
May 28th, 2015 2:39am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics