Ejemplo n.º 1
0
                public void Result(InvokeResult result)
                {
                    var records = result.AsRecord();

                    for (var i = 0; i < records.Length; i++)
                    {
                        if (i == 0)
                        {
                            _Logger.WriteObject(string.Empty, false);
                            _Logger.WriteObject(string.Concat(" -> ", records[i].TargetName, " : ", records[i].TargetType), false);
                            _Logger.WriteObject(string.Empty, false);
                        }

                        if (records[i].IsSuccess())
                        {
                            _Logger.WriteObject(string.Concat("    [+] ", records[i].RuleName), false);
                        }
                        else
                        {
                            _Logger.WriteObject(string.Concat("    [-] ", records[i].RuleName), false);
                            _Logger.WriteObject(string.Empty, false);
                            _Logger.WriteObject(string.Concat("::error:: ", records[i].TargetName, " [FAIL] ", records[i].RuleName), false);
                            Reason(records[i]);
                            if (i + 1 < records.Length)
                            {
                                _Logger.WriteObject(string.Empty, false);
                            }
                        }
                    }
                }
Ejemplo n.º 2
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();
                }
            }
Ejemplo n.º 3
0
 private bool TryConstrained(string uri)
 {
     _Logger.WriteObject(string.Format(PSRuleResources.LaunchBrowser, uri), false);
     return(true);
 }