I have a site collection with some sites (Publishing theme).
I need to add some links to the top navigation bar and the quick launch by Powershell.
$web = Get-SPWeb "http://myurl"
$newLink = New-Object Microsoft.SharePoint.Navigation.SPNavigationNode -ArgumentList @("test", "http://www.google.com");
$web.Navigation.TopNavigationBar.AddAsLast($newLink);
$web.Update();
I tried this code,it runs fine, but I can not see the new link.
If I try to add a new link from the UI, I can not see it in the $web.Navigation.TopNavigationBar
object.
It is working with an other template (ex team site)