I am trying to edit a top navigation bar Heading
's description so at the top ribbon I would have a its description at mouse hover. I am going to have to do it with powershell, as a script, because it is to be deployed and i wont be able to edit it one by one.
function ProcessSubWebs($webAppUrl)
{
$currentWeb = Get-SPWeb $webAppUrl
$publishingWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($currentWeb)
$publishingPages = $publishingWeb.GetPublishingPages()
foreach ($publishingPage in $publishingPages)
{
if($publishingPage.ListItem['Title'] -eq "<Page Name>")
{
$file = $currentWeb.GetFile($publishingPage.Uri.ToString())
[Microsoft.SharePoint.SPListItem]$spListItem = $file.Item
$file.CheckOut()
$spListItem.Description = "<Page Description>"
$spListItem.Update()
$file.CheckIn("Description Added", [Microsoft.SharePoint.SPCheckinType]::MajorCheckIn)
}
}
$currentWeb.Dispose()
}
$webAppUrl = "MyUrl"
ProcessSubWebs($webAppUrl)
Apparently I cannot change description of a list item with $listItem.Description
or $listItem['Description']
I also have tried to do it as a publishingPage but it did not work after update. I'd be glad if you could point me to the right direction.