I have the following powershell which I use to loop through a wiki page library inside my On-Premise site, and filter out all the wiki pages which have been modified after a certain date:
$startdate = Get-Date -Day 05 -Month 03 -Year 2018 -Hour 16 -Minute 00
$startDateIsoFormat = [Microsoft.SharePoint.Utilities.SPUtility]::CreateISO8601DateTimeFromSystemDateTime($startdate)
$emailbody =""
$web = Get-SPWeb "http://****/kb/info"
$userfriendlyURL = "http://www.*****.intra/kb/info"
$list = $web.GetList(($web.ServerRelativeUrl.TrimEnd("/") + "/Pages"))
$spQuery = New-Object Microsoft.SharePoint.SPQuery;
$camlQuery = "<Where><Geq><FieldRef Name='Modified'/><Value Type='DateTime'>$startDateIsoFormat</Value></Geq></Where>";
$spQuery.Query = $camlQuery
$listItems = $list.GetItems($spQuery)
foreach ($item in $listItems)
{
$emailbody = $emailbody + '<br/> <a href ="' + $userfriendlyURL + '/Pages/' + $item["LinkFilename"].toString() + '">' + $item["Title"].toString() + '</a>'
Write-Host "found"
}
Now, I want the same powershell script to run against a SharePoint Online site using PNP script, but I am not sure which commands I need to change and if I can run CAML queries against SP online libraries?