Use the below script and change file name to the desired object
---------------------------------------------------------------------------
$s = Get-SPSite "http://<server name>/"
$w = $s.RootWeb
$ps = New-Object Microsoft.SharePoint.Publishing.PublishingSite($s)
$pls = $ps.PageLayouts
$f = $w.GetFile("/_catalogs/masterpage/<Page Layout Name>.aspx")
Write-Host $f.CustomizedPageStatus
if ($f.CustomizedPageStatus -eq "Customized")
{
Write-Host
Write-Host "Layout page name: " -NoNewline
Write-Host $f.Name
Write-Host "Status before: " -NoNewline
Write-Host $f.CustomizedPageStatus
#$f.RevertContentStream()
Write-Host "Status after: " -NoNewline
Write-Host $f.CustomizedPageStatus
}
$w.Dispose()
$s.Dispose()
No comments:
Post a Comment