protected override void ExecuteCmdlet() { switch (ParameterSetName) { case "WithTitle": { SelectedWeb.AddPublishingPage(PageName, PageTemplateName, Title, publish: Publish); break; } default: { SelectedWeb.AddPublishingPage(PageName, PageTemplateName, publish: Publish); break; } } }
protected override void ExecuteCmdlet() { Folder pageFolder = null; if (!string.IsNullOrEmpty(FolderPath)) { pageFolder = SelectedWeb.EnsureFolderPath(FolderPath); } switch (ParameterSetName) { case "WithTitle": { SelectedWeb.AddPublishingPage(PageName, PageTemplateName, Title, publish: Publish, folder: pageFolder); break; } default: { SelectedWeb.AddPublishingPage(PageName, PageTemplateName, publish: Publish, folder: pageFolder); break; } } }