Aug 19 2019 07:31 AM
Aug 20 2019 11:25 AM
@David Jenkins Hi David, I will answer this in two parts First get all the list columns:
Use the below script:
Connect-PnPOnline https://yourorg.sharepoint.com/sites/demo/ -cred $cred
$ListName = "List1"
$Fields = Get-PnPField -List $ListName
$global:FieldsList = ""
$i =1
foreach($Field in $Fields)
{
$global:FieldsList = $global:FieldsList + $Field.InternalName + ','
Write-Host "Field Number " $i $Field.InternalName
$i++
}
Once you have all the columns select the columns you need :
Then use the below code:
Connect-PnPOnline https://yourorg.sharepoint.com/sites/demo/ -cred $cred
$ListName = "List1"
$Fields = Get-PnPField -List $ListName
$Items= (Get-PnPListItem -List $ListName -Fields "Title","GUID", "Modified","Created","ID")
$i=1
foreach($Item in $Items)
{
Write-Host "Item #" $i -ForegroundColor Yellow
Write-Host "Title :" $Item["Title"]
Write-Host "GUID :"$Item["GUID"]
Write-Host "Modified :"$Item["Modified"]
Write-Host "Created :"$Item["Created"]
$i++
}
Final output will be something like this
Aug 20 2019 11:33 AM
Aug 20 2019 01:24 PM
@David Jenkins Sorry I could not help! If it would be me then, even I will first query the required items and make an array of ids for which I need to run some updates. Then I would just pass that array to do the intended business operation. I tried at my end but unfortunately I could not replicate but I am trying in a new site not in an migrated site. That might be the difference. Best of luck :)