I am working on a Sitemap generator in Powershell for multilingual sites and I am having an issue with the LinkManager.
I changed some of the url options and they all seem to work except UseDisplayName.
When I put a breakpoint and mouse over url options, it shows that UseDisplayName is set to true, but if I use the Immediate Window and get the value, it is returned as false.
Regardless, the display name is never used.
Here is a code sample:
$urlOptions = [Sitecore.Links.LinkManager]::GetDefaultUrlOptions()
$urlOptions.UseDisplayName -value $True
$urlOptions.AlwaysIncludeServerUrl = $True
$urlOptions.ShortenUrls = $True
$urlOptions.SiteResolving = $True
$urlOptions.Language = "fr-ca"
$myUrl = [Sitecore.Links.LinkManager]::GetItemUrl($myItem, $urlOptions)
Any idea what I could be doing wrong?