Exemple #1
0
        protected override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();

            switch (this.ParameterSetName)
            {
            case NewOptionSetParameterSet:
                OptionSetMetadata internalOptionset = BuildOptionSet();
                Guid id1 = _repository.AddOptionSet(internalOptionset);
                if (PassThru)
                {
                    WriteObject(_repository.GetOptionSet(id1));
                }
                break;

            case NewOptionSetByInputObjectParameterSet:
                Guid id2 = _repository.AddOptionSet(InputObject);
                if (PassThru)
                {
                    WriteObject(_repository.GetOptionSet(id2));
                }
                break;

            default:
                break;
            }
        }