문제

I'm trying to write a PowerShell script where I I'm trying to get the all pages name which are created using particular custom page layout.

In my site I have custom page layout with name HomePage.aspx, and I'm trying to get all pages which are created using Home Page layout.

Suggest some PowerShell Script

도움이 되었습니까?

해결책

Try this below PowerShell Script to get the pages created using specific page layouts. Run this script in SharePoint 2013 Management Shell.

$site = get-SPSite http://sp2013vm:5555/
$web = $site.RootWeb
$pweb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)

$pPages = $pWeb.GetPublishingPages();

$pLayouts ="HomePage.aspx" #$pweb.GetAvailablePageLayouts()

foreach ($pPage in $pPages)
{
    if ($pPage.Layout.Name -eq $pLayouts)
    {
        write-host $pPage.Title
    }
} 

Hope this will help you!!!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top