예제 #1
0
        protected override void ProcessRecord()
        {
            try
            {
                // Work with piped IshFeatures object or create a new one.
                IshFeatures ishFeatures = new IshFeatures(IshFeature);
                string      name        = Name ?? "";
                string      value       = Value ?? "";

                WriteVerbose("name[" + name + "] value[" + value + "]");

                if (Name != "")
                {
                    IshFeature ishFeature = new IshFeature(name, value);
                    ishFeatures.AddFeature(ishFeature);
                }

                WriteObject(ishFeatures.Features, true);
            }
            catch (TrisoftAutomationException trisoftAutomationException)
            {
                ThrowTerminatingError(new ErrorRecord(trisoftAutomationException, base.GetType().Name, ErrorCategory.InvalidOperation, null));
            }
            catch (Exception exception)
            {
                ThrowTerminatingError(new ErrorRecord(exception, base.GetType().Name, ErrorCategory.NotSpecified, null));
            }
        }
예제 #2
0
 /// <summary>
 /// Add a ishFeature to the current list.
 /// </summary>
 /// <param name="feature">IshFeature that needs to be added.</param>
 /// <returns>The current list of <see cref="IshFeatures"/>.</returns>
 public IshFeatures AddFeature(IshFeature ishFeature)
 {
     _ishFeatures.Add(ishFeature);
     return(this);
 }