private bool ProcessOutOfBandObjectOutsideDocumentSequence(PSObject so)
        {
            if (!ShouldProcessOutOfBand)
            {
                return(false);
            }

            if (so.InternalTypeNames.Count == 0)
            {
                return(false);
            }

            List <ErrorRecord> errors;
            var fed = OutOfBandFormatViewManager.GenerateOutOfBandData(this.TerminatingErrorContext, _expressionFactory,
                                                                       _typeInfoDataBase, so, _enumerationLimit, false, out errors);

            WriteErrorRecords(errors);

            if (fed != null)
            {
                this.WriteObject(fed);
                return(true);
            }

            return(false);
        }
        private void SendCommentOutOfBand(string msg)
        {
            FormatEntryData fed = OutOfBandFormatViewManager.GenerateOutOfBandObjectAsToString(PSObjectHelper.AsPSObject(msg));

            if (fed != null)
            {
                this.WriteObject(fed);
            }
        }
Пример #3
0
        private bool ProcessOutOfBand(PSObject so, bool isProcessingError)
        {
            List <ErrorRecord> list;
            FormatEntryData    o = OutOfBandFormatViewManager.GenerateOutOfBandData(base.TerminatingErrorContext, this.expressionFactory, this._typeInfoDataBase, so, this.enumerationLimit, true, out list);

            if (!isProcessingError)
            {
                this.WriteErrorRecords(list);
            }
            if (o != null)
            {
                this.WriteObject(o);
                return(true);
            }
            return(false);
        }
        private bool ProcessOutOfBand(PSObject so, bool isProcessingError)
        {
            List <ErrorRecord> errors;
            FormatEntryData    fed = OutOfBandFormatViewManager.GenerateOutOfBandData(this.TerminatingErrorContext, _expressionFactory,
                                                                                      _typeInfoDataBase, so, _enumerationLimit, true, out errors);

            if (!isProcessingError)
            {
                WriteErrorRecords(errors);
            }

            if (fed != null)
            {
                this.WriteObject(fed);
                return(true);
            }

            return(false);
        }
Пример #5
0
 private bool ProcessOutOfBandObjectOutsideDocumentSequence(PSObject so)
 {
     if (this.ShouldProcessOutOfBand)
     {
         List <ErrorRecord> list;
         FormatEntryData    o = null;
         if (so.InternalTypeNames.Count == 0)
         {
             return(false);
         }
         o = OutOfBandFormatViewManager.GenerateOutOfBandData(base.TerminatingErrorContext, this.expressionFactory, this._typeInfoDataBase, so, this.enumerationLimit, false, out list);
         this.WriteErrorRecords(list);
         if (o != null)
         {
             this.WriteObject(o);
             return(true);
         }
     }
     return(false);
 }