PowerShell Update Top Link Bar or Global Navigation

I needed to update hundreds of sub sites to inherit the same top link bar as the parent site.   Using PowerShell with SharePoint, this only took a minute.

Global Navigation

Display the same navigation items as the parent site (wanted this to be checked)

 
$SiteCollection = Get-SPSite "http://sharepoint/sitecollection/" 
foreach ($subSite in $SiteCollection.AllWebs) 
{ $updateSite = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($subSite) $updateSite.Navigation.InheritGlobal = $true $updateSite.Navigation.ShowSiblings = $false $subSite.Update() 
$subSite.Dispose() } 

$SiteCollection.Dispose()