public static void DeleteWebPart() { string SharePointOnline_OR_OnPremise = "OP"; string UserName = "******"; string Password = "******"; string Domain = "MGMT7"; //string webUrl = "https://intranet.poc.com/sites/TestContosoPublishingSite/"; //string ServerRelativePageUrl = "/sites/TestContosoPublishingSite/Pages/TestWebPartTransformation.aspx"; string outPutDirectory = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\DeleteWebPart"; //string webPartTitle = "Featured Links Web Part"; //string zoneIndex = "1"; //string zoneId = "Left Column"; //Guid webPartID = new Guid("c7d8da93-0d50-4587-89d6-cd4e3663c660"); Guid StorageKey = new Guid("d2d4f7bd-6f2d-4677-b4f9-f63a59e09317"); Guid webPartID = new Guid("40d61b73-b96e-44d4-a2d3-504dce482f99"); string webUrl = "https://intranet.poc.com/sites/TestContosoTeamSite/"; string ServerRelativePageUrl = "/sites/TestContosoTeamSite/SitePages/TestWebPart.aspx"; WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.DeleteWebPart(webUrl, ServerRelativePageUrl, webPartID, outPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.DeleteWebPart(WebUrl, ServerRelativePageUrl, StorageKey, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain, "web"); }