[PS] SharePoint - List All WebParts in Pages
Add-PSSnapin Microsoft.SharePoint.PowerShell
clear
$wUrl = 'http://acme.com/'
$lName = 'Pages'
$w = Get-SPWeb $wUrl
$l = $w.Lists[$lName]
# $item = $l.GetItemById(4)
$l.Items | % {
$item = $_
"$($item.Title): $($item.Url)"
$mgr = $w.GetLimitedWebPartManager("$($item.Url)", [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
$mgr.WebParts|%{ "`t$($_.Title) :: $($_.WebBrowsableObject)" }
"=============================================="
}
Comments