protected override void ProcessRecord()
        {
            WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper();
            string csvFile = OutPutDirectory + @"\" + System.IO.Path.GetFileNameWithoutExtension(WebPartUsageFilePath) + "_DeleteOperationStatus" + "_" + DateTime.Now.ToString("dd_MM_yyyy_hh_ss") + ".csv";


            if (String.Equals(Transformation.PowerShell.Common.Constants.ActionType_All, SourceWebPartType, StringComparison.CurrentCultureIgnoreCase))
            {
                //Reading Input File
                IEnumerable <WebPartDiscoveryInput> objWPDInput;

                objWPDInput = ImportCsv.ReadMatchingColumns <WebPartDiscoveryInput>(WebPartUsageFilePath, Transformation.PowerShell.Common.Constants.CsvDelimeter);

                if (objWPDInput.Any())
                {
                    IEnumerable <string> webPartTypes = objWPDInput.Select(x => x.WebPartType);

                    webPartTypes = webPartTypes.Distinct();

                    foreach (string webPartType in webPartTypes)
                    {
                        webPartTransformationHelper.DeleteWebPart_UsingCSV(webPartType, WebPartUsageFilePath, OutPutDirectory, csvFile, SharePointOnline_OR_OnPremise, UserName, Password, Domain);
                    }
                }
            }
            else
            {
                webPartTransformationHelper.DeleteWebPart_UsingCSV(SourceWebPartType, WebPartUsageFilePath, OutPutDirectory, csvFile, SharePointOnline_OR_OnPremise, UserName, Password, Domain);
            }
        }
Пример #2
0
        public static void DeleteWebPart_UsingCSV()
        {
            //string SharePointOnline_OR_OnPremise = "OP";
            //string UserName = "******";
            //string Password = "******";
            //string Domain = "MGMT7";
            // string usageFilePath = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\GetWebPartPropertiesByCSV\WebParts_Usage.csv";
            //string sourceWebPartTitle = "Featured Links Web Part";
            // string outPutDirectory = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\DeleteWebPartByCSV";



            string SharePointOnline_OR_OnPremise = "OP";
            string UserName           = ConfigurationManager.AppSettings["userName"];
            string Password           = ConfigurationManager.AppSettings["password"];
            string Domain             = ConfigurationManager.AppSettings["domain"];
            string WebUrl             = ConfigurationManager.AppSettings["siteurl"];
            string outPutDirectory    = ConfigurationManager.AppSettings["outputpath"];
            string usageFilePath      = ConfigurationManager.AppSettings["usagefilepath"];
            string sourceWebPartTitle = ConfigurationManager.AppSettings["sourcewebparttype"];
            WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper();

            webPartTransformationHelper.DeleteWebPart_UsingCSV(sourceWebPartTitle, usageFilePath, outPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain);
        }
 protected override void ProcessRecord()
 {
     WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper();
     webPartTransformationHelper.DeleteWebPart_UsingCSV(InputFolder, SharePointOnline_OR_OnPremise, UserName, Password, Domain);
 }
Пример #4
0
        protected override void ProcessRecord()
        {
            WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper();

            webPartTransformationHelper.DeleteWebPart_UsingCSV(SourceWebPartType, WebPartUsageFilePath, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain);
        }
Пример #5
0
        protected override void ProcessRecord()
        {
            WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper();

            webPartTransformationHelper.DeleteWebPart_UsingCSV(InputFolder, SharePointOnline_OR_OnPremise, UserName, Password, Domain);
        }