Add-Type –Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type –Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
$siteURL = "https://siteURL.sharepoint.com/sites/DevSite"
$userId = "[email protected]"
$pwd = "Enter password"
$creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userId, $pwd)
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteURL)
$ctx.credentials = $creds
$contentTypes = $ctx.web.contenttypes
$ctx.load($contentTypes)
$ctx.executeQuery()
foreach($ct in $contentTypes){
write-host $ct.name
}To Get SharePoint Online Content Type using PowerShell.
