I've adapted a PowerShell script from Harry Chen's "SharePoint Connoisseur" blog to solve the broken Navigation Up issue he describes. My code is slightly modified, but only to reduce the data captured and the sample size. Here's a code snippet:
$data = @()
Try
{
$site = Get-SPSite -Identity "http://theclients/site/collection"
}
Catch [system.exception]
{
Write-Host $_.Exception.ToString()
}
foreach($web in $site.AllWebs)
{
foreach($list in $web.Lists)
{
if($list.Title -eq "Pages")
{
DO STUFF
}
}
}
When I attempt to run the script (from SharePoint 2010 Management Shell as Administrator) I receive the following error:
C:\GetPagesInNeedOfUpdate.ps1 : Exception has been thrown by the target of an i
nvocation.
At line:1 char:30
+ C:\GetPagesInNeedOfUpdate.ps1 <<<<
+ CategoryInfo : NotSpecified: (:) [GetPagesInNeedOfUpdate.ps1],
TargetInvocationException
+ FullyQualifiedErrorId : System.Reflection.TargetInvocationException,GetP
agesInNeedOfUpdate.ps1
Which is pretty ambiguous. Also, there is no character 30 at line 1...
Is this a permissions issue? The execution policy is set to Unrestricted so I know it isn't that, and my user has full control and is the primary site collection administrator.
What could be causing this?