I have used the below code for change the web part properties.how to change the web part zone index in existing web part in the page? My code is :
$pagePath = "Pages/default.aspx"
$pageUrl = $SiteURL + $pagePath
$web = Get-SPWeb $SiteURL
$PublishingWeb=[Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$Page = $PublishingWeb.GetPublishingPages()
$Page.CheckOut()
$spWebPartManager = $web.GetLimitedWebPartManager($pageUrl, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
foreach ($webpart in ($spWebPartManager.WebParts | Where-Object {$_.Title -eq "Sample Name"}))
{
$spWebPartManager.SaveChanges($webpart);
break;
}
$Page.CheckIn("checkin")
Suggest any idea.