in the output from rest API: https://graph.microsoft.com/beta/sites//lists//items, I can get the Listitem value like this:
"@odata.etag": xxx,
"createdDateTime": xxx,
"eTag": xxx,
"id": xx,
"lastModifiedDateTime": xx,
"webUrl": xxx,
"createdBy": {
"user": {
"displayName": "System Account"
}
},
I want to get these item data for each List item, but in below foreach code, I only can get item's title and Id:
$spqQuery = [Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery()
$items=$ll.GetItems($spqQuery)
$ctx.Load($items)
$ctx.ExecuteQuery()
foreach($item in $items){
Write-Host $item["Title"] $item["id"] -f Yellow
}
If I write $item["webUrl"], will get empty value. How can get others list item data in powershell?
You could use PnP PowerShell for this easily.