I've created a design package for custom look & feel in SharePoint 2013 sites. After importing the package if I visit SharePoint hosted apps, master-page seem to be broken.
I've tried to fix master-page using below PowerShell but it doesn't seem to work.
if ( (Get-PSSnapin -Name "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null ) {
Add-PSSnapin "Microsoft.SharePoint.PowerShell"}
Start-SPAssignment -Global
$SelectedPortalUrl = "Site-URL"
# loop all webs that are APPs
Get-SPSite $SelectedPortalUrl | Get-SPWeb -Limit All -filter { $_.Template -eq "APP" } | Foreach-Object {
$_.MasterUrl = $_.ServerRelativeUrl + "/_catalogs/masterpage/app.master"
$_.CustomMasterUrl = $_.ServerRelativeUrl + "/_catalogs/masterpage/app.master"
#Write-Host $_.MasterUrl
#Write-Host $_.CustomMasterUrl
#Write-Host "Fixed: " $_.Name -Fore Green
}
Stop-SPAssignment -Global
How can I ensure that design package doesn't change app's master-page?
Edit: Observation - If I directly deploy app to developer site, this breaks. If I use app update method & push newer version to app catalog, issue doesn't replicate.