I am trying to manage a changelog in a Sharepoint Online custom task list with Powershell and CSOM. I can get changes in a list from the below code and retrieve details like Update type and Update time. But I want more details regarding the item that has changed. For example, the item's new value, old value, the column/row name and the user who made the change.
I searched MSDN but could not find any classes that would help me get these types of details. Existing methods that I could find through googling would parse HTML through the pages. This would not help me since I assume it would be a lot slower than CSOM and since my table is big enough and changes being made all the time, it would be inefficient to parse. Here is the code I am working on in PowerShell:
Function Get-ChangeLog {
$listName = "Tasks"
$list = $clientContext.Web.Lists.GetByTitle($listName)
$cq = new-object Microsoft.Sharepoint.Client.ChangeQuery($true,$true)
$changes = $list.GetChanges($cq)
$clientContext.Load($changes)
$clientContext.ExecuteQuery()
$changes.Count
foreach ($changeItem in $changes) {
#each item details
}
}