public override void Execute()
        {
            base.Execute();
            var authorization = new PSExpressRouteCircuitAuthorization();

            authorization.Name = this.Name;

            WriteObject(authorization);
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            var authorization = new PSExpressRouteCircuitAuthorization();

            authorization.Name = this.Name;

            WriteObject(authorization);
        }
示例#3
0
        public override void Execute()
        {
            base.Execute();
            var authorization = this.ExpressRouteCircuit.Authorizations.SingleOrDefault(resource => string.Equals(resource.Name, this.Name, System.StringComparison.CurrentCultureIgnoreCase));

            if (authorization != null)
            {
                throw new ArgumentException("Authorization with the specified name already exists");
            }

            authorization = new PSExpressRouteCircuitAuthorization();

            authorization.Name = this.Name;
            this.ExpressRouteCircuit.Authorizations.Add(authorization);

            WriteObject(this.ExpressRouteCircuit);
        }