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); } }
public static void Error(object value) { string txt = ErrorPrefix + value.ToString(); if (AutomaticNewline) { ErrorStream.WriteLine(txt); } else { ErrorStream.Write(txt); } }
public void WriteErrorLine(string line) => ErrorStream.Write(line + EndOfLine);
public void WriteError(object value) { ErrorStream.Write(value); }