1
設置爲MOSS2007。我迭代QuickLaunch中的鏈接,並更新URL:通過PowerShell更新SharePoint快速啓動鏈接URL
$siteUrl = "http://myserver/"
$spSite = new-object Microsoft.SharePoint.SPSite($siteurl)
for($i=0; $i -lt $spSite.AllWebs.Count;$i++)
{
$spWeb = $spSite.AllWebs[$i]
$nodes = $spWeb.Navigation.QuickLaunch
for($j=0; $j -lt $nodes.Count;$j++)
{
$children = $nodes[$j].Children
for($k=0; $k -lt $children.Count;$k++)
{
$x = $children[$k]
$x.Url = "http://mylink/"
$x.Update()
}
}
$spSite.Dispose();
}
但Doclib URL不更新。如果我轉到網站設置 - >導航 - >並通過用戶界面編輯URL,然後再次運行我的腳本,URL更新。爲什麼我無法通過代碼操縱網址?
PowerShell版本是1.0。 MOSS具有發佈功能。 – andersbs 2010-11-25 10:03:15