예제 #1
0
        protected override void ExecuteCmdlet()
        {
            Folder pageFolder = null;

            if (!string.IsNullOrEmpty(FolderPath))
            {
                pageFolder = CurrentWeb.EnsureFolderPath(FolderPath);
            }

            switch (ParameterSetName)
            {
            case "WithTitle":
            {
                CurrentWeb.AddPublishingPage(PageName, PageTemplateName, Title, publish: Publish, folder: pageFolder);
                break;
            }

            default:
            {
                CurrentWeb.AddPublishingPage(PageName, PageTemplateName, publish: Publish, folder: pageFolder);
                break;
            }
            }
        }