public override void End()
            {
                _Formatter.End(_TotalCount, _FailCount, _ErrorCount);
                base.End();
                try
                {
                    if (_ErrorCount > 0)
                    {
                        base.WriteError(new ErrorRecord(new FailPipelineException(PSRuleResources.ErrorPipelineException), "PSRule.Error", ErrorCategory.InvalidOperation, null));
                    }
                    else if (_FailCount > 0)
                    {
                        base.WriteError(new ErrorRecord(new FailPipelineException(PSRuleResources.FailPipelineException), "PSRule.Fail", ErrorCategory.InvalidData, null));
                    }

                    if (_Results != null && _CmdletContext != null)
                    {
                        _CmdletContext.SessionState.PSVariable.Set(_ResultVariableName, _Results.ToArray());
                    }
                }
                finally
                {
                    if (_InnerWriter != null)
                    {
                        _InnerWriter.End();
                    }
                }
            }
        public virtual void End()
        {
            if (_Writer == null)
            {
                return;
            }

            _Writer.End();
        }
Exemple #3
0
            public override void End()
            {
                _Logger.WriteObject(string.Empty, false);
                if (_FailCount > 0)
                {
                    _Logger.WriteError(new ErrorRecord(new FailPipelineException(PSRuleResources.FailPipelineException), "PSRule.Fail", ErrorCategory.InvalidData, null));
                }

                if (_InnerWriter != null)
                {
                    _InnerWriter.End();
                }
            }
Exemple #4
0
 public virtual void End()
 {
     Writer.End();
 }