Created
March 20, 2020 18:22
-
-
Save michaellwest/1045797fbd0241658a4c04b47447c7b9 to your computer and use it in GitHub Desktop.
Validate the xml stored in a GeneralLink field using Sitecore PowerShell Extensions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$linkItems = Get-ChildItem -Path "master:" -ID "{66FD3C09-517C-4691-82AF-E300AC6BA329}" -Recurse -Depth 2 | | |
Where-Object { $_.TemplateId -eq "{41BAA575-6B15-4356-8F25-9CEE8F9D6D95}" } | |
foreach($linkItem in $linkItems) { | |
try { | |
[Sitecore.Xml.XmlUtil]::GetXmlNode($linkItem.NavigationLink) > $null | |
} catch { | |
$linkItem | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment