title: Update SharePoint Online columns/content types with CSOM
body: <p>I have the following csom script to update site columns and push down the changes:</p>
  
  <pre><code>Add-Type -Path "Libraries\Microsoft.SharePoint.Client.dll" 
  Add-Type -Path "Libraries\Microsoft.SharePoint.Client.Runtime.dll" 
  
  $webUrl = "enter_url_here" 
  $username = "enter_username_here"
  $password = "enter_password_here"
  $securePass = ConvertTo-SecureString $password -AsPlainText -Force
  
  $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
  $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePass)
  
  #Add description to the "Other category" field
  $fieldTitle = "Other category"
  $fieldDesc = "Search for an existing name before adding new entries"
  $field = $ctx.Site.RootWeb.Fields.GetByInternalNameOrTitle($fieldTitle)
  $field.Description = $fieldDesc
  $field.UpdateAndPushChanges($true)
  
  #Add description to the "Initiator location" field
  $field2Title = "Initiator location"
  $field2 = $ctx.Site.RootWeb.Fields.GetByInternalNameOrTitle($field2Title)
  $field2.Description = $fieldDesc
  $field2.UpdateAndPushChanges($true)
  
  #Setting the "Main-category" field as required/mandatory
  $field3Title = "Main-category"
  $field3 = $ctx.Site.RootWeb.Fields.GetByInternalNameOrTitle($field3Title)
  $field3.Required = $true
  $field3.UpdateAndPushChanges($true)
  
  $ctx.ExecuteQuery()
  </code></pre>
  
  <p>The above fields/columns are all part of the site content type called "Main Documents".</p>
  
  <p>So far this works fine, however for the "Main-category" field how do I set it to be "Required" at the content type level? at the moment this is only being set at the site column level, what would be the easiest way to achieve this?</p>
  
  <p>Many Thanks.</p>