Hi,
My requirement is to add a listviewwebpart to sevarala publishing pages and i am trying to do it through powershell.
I need only 'summary view' to be added as default when this web part is added. My example script is:
$SPWeb = Get-SPWeb $WebUrl
$wpPage = $SPWeb.GetFile("Pages\Default.aspx")
$wpPage.Checkout()
$wpManager = $wpPage.GetLimitedWebPartManager([System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
$list = $SPWeb.Lists["Calendar"]
$wpView = New-Object "Microsoft.SharePoint.WebPartPages.ListViewWebPart"
$wpView.ListName = $list.ID.ToString("B").ToUpper()
$wpView.ViewType = "None"
$wpView.ViewGuid = ""
$wpManager.AddWebPart($wpView,"RightZone",2)
$wpManager.SaveChanges($wpView)
But this code is adding default calendar view to the page but i need only summary view to be added to the page. how can id do that?
TIA.