I have started with the following code to retrieve the List Items for JSON files found in my document library:
Try {
#Connect to PNP Online
Connect-PnPOnline -Url $siteUrl -UseWebLogin
$CAMLQuery1 = "<View Scope='RecursiveAll'>
<Query>
<Where>
<Eq>
<FieldRef Name='FileLeafRef'></FieldRef>
<Value Type='Text'>content.json</Value>
</Eq>
</Where>
</Query></View>"
$FolderItems = Get-PnPListItem -List $ListName -Query $CAMLQuery1
ForEach($Item in $FolderItems)
{
Write-host $Item
}
}
catch {
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}
How do I get the json content of the file I fetched through the CAML request? I tried to find some solution, but couldn't find anything.