SP 2013 Publish Master page gallery using Powershell script

The below script will be useful for approving the master page gallery files using Powershell script


Add-PsSnapin Microsoft.SharePoint.PowerShell -erroraction silentlycontinue
$strStatusApproved= [Microsoft.SharePoint.SPModerationStatusType]::Approved;
$strStatusRejected= [Microsoft.SharePoint.SPModerationStatusType]::Rejected;
$strStatusPending= [Microsoft.SharePoint.SPModerationStatusType]::Pending;
$webAppUrl = "http://SPSiteURL"
function fnCheckInFolder($folder)
{
if($folder-ne $null -and $folder.item -ne $null -and $folder.item.ModerationInformation -ne $strStatusApproved -and $folder.item.ModerationInformation -ne $strStatusRejected )
{
write-host (" Approving the folder {0} " -f $folder.item.Url)
$comment = $folder.item.ModerationInformation
$comment.Status = $strStatusApproved
$folder.Item.Update()
$folder.update()
}
$j=0
if($folder-ne $null -and $folder.Url.Contains("/img") -eq $true)
{

$folder.Files |?{ $_.Item -ne $null -and $_.Item.File.CheckOutType -ne “None”} | % {
$_.Item[“ContentTypeId”]=”0x010100C5033D6CFB8447359FB795C8A73A2B19″
$_.Item.Update()
$_.Item.File.CheckIn(“”)
$_.Item.file.Publish(“”)
$_.Item.file.Approve(“”)

}
}
$folder.Files | ?{ $_.Item -ne $null -and $_.Item.Properties[“HtmlDesignLockedFile”] -eq $null -and $_.MinorVersion -ne 0 } | %{
if($_.Url.Contains(“.html”) ){
# design file .html master page checkin
$_.Item[“ContentTypeId”]=”0x0101000F1C8B9E0EB4BE489F09807B2C53288F0054AD6EF48B9F7B45A142F8173F171BD10003D357F861E29844953D5CAA1D4D8A3A”
$_.Item.Update()
$_.Item.File.CheckIn(“”)
$_.Item.file.Publish(“”)
$_.Item.file.Approve(“”)
Write-Host (” Master page {0} status ” -f $_.Url,$_.item.File.CheckOutStatus);

}

if($_.Url.Contains(“.css”) -or $_.Url.Contains(“.js”)) {

$i =0
if ($_.Item.File.CheckOutType -ne “None”)
{
# design files css/js checkin
Write-Host (” Items Publishing {0} ” -f $_.Url,$_.Item.ContentType.Name );
$_.Item[“ContentTypeId”]=”0x010100C5033D6CFB8447359FB795C8A73A2B19″
$_.Item.Update()
$_.Item.File.CheckIn(“”)
$_.Item.file.Publish(“”)
$_.Item.file.Approve(“”)
}

}

}

$folder.SubFolders | %{ fnCheckInFolder $_;}
}

$rootWeb = Get-SPWeb $webAppUrl
$rootWeb.Title
$masterPageFolder= $rootWeb.GetFolder(“_catalogs/masterpage”)
fnCheckInFolder($masterPageFolder)

 

SSRS 2012 installation failed in SharePoint 2013 integrated mode

SSRS 2012 installation in SharePoint 2013 integration mode , sometimes failed. It may be the due to the SharePoint web applications web.config file may contains < ! - - comments - - > lines (this is one of the reason for the failure)

Try to remove the comments < ! - - comments - - > lines lines  and try to install.

It’s better to install SSRS in SharePoint 2013 server at initial stage so that before customizing the web.config (with comments lines) to avoid this problem.

Hope this may helpful for someone.