I am newbie in Powershell scripting, I'd like to ask if you can help me do a script.
The objective is to compare Sharepoint List A that has, say 100 records with attachments versus another Sharepoint List B that has 50 records.
I need to update List B with the difference including attachments from List A records.
$SiteURL = "projects.crescent.com"
Connect-PnPOnline -url $SiteURL –Credentials (Get-Credential)
$ListOneName = "T1"
$ListTwoName = "T2"
#Get site and List objects
$ColumnToCompare = "Change ID #"
#$Web = Get-SPWeb $SiteURL
$ListOne = $web.lists[$ListOneName]
$ListTwo = $web.lists[$ListTwoName]
#Fetch specific Column Values from each list to compare
$ListOneValues = @()
$ListTwoValues = @()
$ListOne.Items |
foreach { $ListOneValues+= $_[$ColumnToCompare] }
$ListTwo.Items |
foreach { $ListTwoValues+= $_[$ColumnToCompare] }
Compare-Object $ListOneValues $ListTwoValues # -PassThru