Beispiel #1
0
        public void WriteError(ErrorRecord errorRecord)
        {
            var psobj = PSObject.AsPSObject(errorRecord);

            // if merged with stdout, we can later on check to which stream the object usually belongs
            psobj.WriteToErrorStream = true;
            ErrorStream.Write(psobj);
            ExecutionContext.AddToErrorVariable(errorRecord);
            if (MergeErrorToOutput)
            {
                OutputStream.Write(psobj);
            }
        }
Beispiel #2
0
        public static void Error(object value)
        {
            string txt = ErrorPrefix + value.ToString();

            if (AutomaticNewline)
            {
                ErrorStream.WriteLine(txt);
            }
            else
            {
                ErrorStream.Write(txt);
            }
        }
Beispiel #3
0
 public void WriteErrorLine(string line) => ErrorStream.Write(line + EndOfLine);
Beispiel #4
0
 public void WriteError(object value)
 {
     ErrorStream.Write(value);
 }