I have this Power Shell script which work on SharePoint 2013 on-premises:
$NewHireList = $spSourceWeb.Lists["ONB New Hire"]
$NewHireItem = $NewHireList.Items | Where {$_["Candidate ID"] -eq $CandidateID -and $_["Onboarding Status"] -notin "Canceled","Completed"}
And I want to convert it using PNP PowerShell to work on SharePoint online, currently I got this:
$NewHireItem = Get-PnPListItem -List "ONB New Hire" -PageSize 100 -Query "<View><Query><Where><Eq><FieldRef Name='Candidate ID'/><Value Type='Number'>$CandidateID</Value></Eq></Where></Query></View>" -ScriptBlock { Param($items) $items.Context.ExecuteQuery()} | ForEach-Object {
But not sure how I can presents -notin
inside CAML?