Forever grateful to Salaudeen Rajack for all the contributions over the years for SharePoint admin community. Recently I was tasked with changing values en masse of a column in a list of type picture/ hyperlink field in a SharePoint online list. The requirement was if you find a string in such a field replace a part of the string in all values. https://www.sharepointdiary.com/2017/08/sharepoint-online-update-hyperlink-field-using-powershell.html#ixzz6hNcutSdB
provides the main idea. But I had to marry this concept to all items in a list. This is not the most efficient way, but here is what I had to come up with quickly:
#Config Variables $SiteURL = "Your site/ subsite where the list resides" $ListName = "Your list name" $counter = 0 $maxCount = 2500 #Connect to PnP Online Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential) #$myItem = Get-PnPListItem -List $ListName -Id $ItemID #Loop through list and Update Hyperlink column #value using PowerShell $listItems = Get-PnPListItem -List $ListName -Fields "Title","Column name with picture/ hyperlink column name" -PageSize 1000 ForEach ($item in $listItems) { $subCatUrl = $item["Column name with picture/ hyperlink column name"].Url.ToLower() if ($subCatUrl.Contains("Your replacable content")) { $newsubCatUrl = $subCatUrl.Replace("Your replacable content","Your desired content") Set-PnPListItem -List $ListName -Identity $item["ID"] -Values @{"Column name with picture/ hyperlink column name"= "$newsubCatUrl, $subCatText"} Write-Host $item["ID"] "Changed" -ForeGroundColor yellow $counter++ If ($counter -ge $maxCount){break;} } else { Write-Host "No Your replacable content found in" $item["ID"] -ForeGroundColor magenta } Write-Host "Total items processed are " $counter -ForeGroundColor green