Ejemplo n.º 1
0
        protected override void ExecuteCmdlet()
        {
            if (ParameterSetName == ParameterSet_REMOVEALLNODES)
            {
#pragma warning disable CS0618 // Type or member is obsolete
                if (Force || ShouldContinue(string.Format(Resources.RemoveNavigationNodeInLocation, Location), Resources.Confirm))
                {
                    CurrentWeb.DeleteAllNavigationNodes(Location);
                }
#pragma warning restore CS0618 // Type or member is obsolete
            }
            else
            {
                if (Force || ShouldContinue("Remove node?", Resources.Confirm))
                {
                    if (ParameterSetName == ParameterSet_BYID)
                    {
                        var node = CurrentWeb.Navigation.GetNodeById(Identity.Id);
                        node.DeleteObject();
                        ClientContext.ExecuteQueryRetry();
                    }
                    else
                    {
#pragma warning disable CS0618 // Type or member is obsolete
                        CurrentWeb.DeleteNavigationNode(Title, Header, Location);
#pragma warning restore CS0618 // Type or member is obsolete
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected override void ExecuteCmdlet()
        {
            var list = CurrentWeb.CreateList(Template, Title, EnableVersioning, true, Url, EnableContentTypes, Hidden);

            if (Hidden)
            {
                CurrentWeb.DeleteNavigationNode(Title, "Recent", PnP.Framework.Enums.NavigationType.QuickLaunch);
            }
            if (OnQuickLaunch)
            {
                list.OnQuickLaunch = true;
                list.Update();
                ClientContext.ExecuteQueryRetry();
            }

            WriteObject(list);
        }