I want to get all pages and their layout using powershell in a given web application

filter Get-PublishingPages {
$pubweb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($_)
$query = new-object Microsoft.SharePoint.SPQuery

$query.ViewAttributes = "Scope='Recursive'"

Get-SPSite -WebApplication http://sharepoint -Limit All | Select -ExpandProperty AllWebs | Get-PublishingPages | select Uri, Title, @{Name='PageLayout';Expression={$_.Layout.ServerRelativeUrl}}| Format-List

Source: https://stackoverflow.com/questions/18606341/powershell-to-list-all-pages-with-their-layout-across-the-rootweb-and-all-subweb

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.