We got duplicate dynamic placeholders
assigned in Final Layout. How can I remove the duplicates from the Final Layouts in all the languages?
This is how we are filtering out the placeholders matching the regex. In $matches we get the collection of all the dynamic placeholders, the next step is to remove the duplicates and I want to avoid the nested looping to check and delete:
Get-Rendering -Item $_ | ForEach-Object {
$rendering = $_;
$matches = [regex]::Matches($_.Placeholder,'(-{[0-9a-fA-F]{8}[-][0-9a-fA-F]{4}[-][0-9a-fA-F]{4}[-][0-9a-fA-F]{4}[-][0-9a-fA-F]{12}}-0)')
if ($matches.Success) {
$newPlaceholder = $rendering.Placeholder
$matches | ForEach-Object {
$renderingId = $_.Value
}