Пример #1
0
        protected override void ExecuteCmdlet()
        {
            switch (Scope)
            {
            case CustomActionScope.Web:
                CurrentWeb.AddJsLink(Name, Url, Sequence);
                break;

            case CustomActionScope.Site:
                ClientContext.Site.AddJsLink(Name, Url, Sequence);
                break;

            case CustomActionScope.All:
                ThrowTerminatingError(new ErrorRecord(new Exception("Scope parameter can only be set to Web or Site"), "INCORRECTVALUE", ErrorCategory.InvalidArgument, this));
                break;
            }
        }