I am trying to get a list of content types with PowerShell using CSOM. I was able to get list of fields, however when I try to get a list of content types, it's empty.. here's the code am using:
$password = "somepassword" | ConvertTo-SecureString -AsPlainText -Force $context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $context.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials("email",$password) $fields = $context.web.fields $contentTypes = $context.web.ContentTypes $context.load($fields) $context.load($contentTypes) $context.ExecuteQuery()
when I check the list of fields, I can see results there, however content types is always empty. Any reason?