Replies: 1 comment
-
If i use this code i get the title for each version just fine.
If you are searching for a substring in the title you should use either regex -match or use -like
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Community,
I'm having below snippet which will loop through each item version history and checks for specific string is present in title column or not.
And I've an item with 3 versions and the child loop is looping thrice as expected. However, I'm not getting any value in either $version.FieldValues.Title or $version.FieldValues. Am I missing something here ?
foreach ($item in $items) { Write-Host "ID: $($item.Id)" $itemVersions = Get-PnPListItemVersion -List $listName -Identity $item.Id foreach ($version in $itemVersions) { Write-Host "$version" if ($version.FieldValues.Title -eq $searchString) { Write-Host "ID: $($item.Id)" $found = $true break } } }
Beta Was this translation helpful? Give feedback.
All reactions