public void WriteVerbose(PSCmdletBase cmdlet, object obj) { if (UnitTestMode) { UnitTestOutput.CheckInitialized(); UnitTestOutput.StartAddingOutput(); } string cmdletName = "? : "; string objectString = string.Empty; try { objectString = obj.ToString(); } catch {} if (null != cmdlet) { try { cmdletName = CmdletSignature(cmdlet); cmdlet.WriteVerbose(cmdletName + objectString); } catch { cmdlet.WriteVerbose(cmdletName + "failed"); } } else { cmdlet.WriteVerbose(cmdletName + objectString); } }
public virtual void WriteObject(PSCmdletBase cmdlet, string outputObject) { if (UnitTestMode) { UnitTestOutput.CheckInitialized(); UnitTestOutput.StartAddingOutput(); } writeSingleObject(cmdlet, outputObject); }
public void WriteObject(PSCmdletBase cmdlet, object outputObject) { if (UnitTestMode) { UnitTestOutput.CheckInitialized(); UnitTestOutput.StartAddingOutput(); } // cmdlet.WriteVerbose(cmdlet, "outputting the object"); writeSingleObject(cmdlet, outputObject); }
public virtual void WriteObject(PSCmdletBase cmdlet, Hashtable outputObjectCollection) { BeforeWriteCollection(cmdlet, outputObjectCollection); if (UnitTestMode) { UnitTestOutput.CheckInitialized(); UnitTestOutput.StartAddingOutput(); } writeSingleObject(cmdlet, outputObjectCollection); AfterWriteCollection(cmdlet, outputObjectCollection); }
public virtual void WriteObject(PSCmdletBase cmdlet, IList outputObjectCollection) { BeforeWriteCollection(cmdlet, outputObjectCollection); if (UnitTestMode) { UnitTestOutput.CheckInitialized(); UnitTestOutput.StartAddingOutput(); } foreach (object item in outputObjectCollection) { writeSingleObject(cmdlet, item); } AfterWriteCollection(cmdlet, outputObjectCollection); }
public virtual void WriteObject(PSCmdletBase cmdlet, object[] outputObjectCollection) { BeforeWriteCollection(cmdlet, outputObjectCollection); if (UnitTestMode) { UnitTestOutput.CheckInitialized(); UnitTestOutput.StartAddingOutput(); } for (int i = 0; i < outputObjectCollection.Length; i++) { writeSingleObject(cmdlet, outputObjectCollection[i]); } AfterWriteCollection(cmdlet, outputObjectCollection); }
public virtual void WriteObject(PSCmdletBase cmdlet, ICollection outputObjectCollection) { BeforeWriteCollection(cmdlet, outputObjectCollection); if (UnitTestMode) { UnitTestOutput.CheckInitialized(); UnitTestOutput.StartAddingOutput(); } foreach (var outputObject in outputObjectCollection) { // this.WriteVerbose(this, "something to output!!!!!!!!!!1"); //WriteObject(cmdlet, outputObject); writeSingleObject(cmdlet, outputObject); } AfterWriteCollection(cmdlet, outputObjectCollection); }
public virtual void WriteObject(PSCmdletBase cmdlet, IEnumerable outputObjectCollection) { BeforeWriteCollection(cmdlet, outputObjectCollection); if (UnitTestMode) { UnitTestOutput.CheckInitialized(); UnitTestOutput.StartAddingOutput(); } IEnumerator en = outputObjectCollection.GetEnumerator(); while (en.MoveNext()) { writeSingleObject(cmdlet, en.Current); } AfterWriteCollection(cmdlet, outputObjectCollection); }
public virtual void WriteObject(PSCmdletBase cmdlet, ArrayList outputObjectCollection) { BeforeWriteCollection(cmdlet, outputObjectCollection); if (UnitTestMode) { UnitTestOutput.CheckInitialized(); //UnitTestOutput.Add(outputObjectCollection); UnitTestOutput.StartAddingOutput(); } for (int i = 0; i < outputObjectCollection.Count; i++) { WriteObject(cmdlet, outputObjectCollection[i]); } AfterWriteCollection(cmdlet, outputObjectCollection); }
public virtual void WriteObject(PSCmdletBase cmdlet, List <object> outputObjectCollection) { BeforeWriteCollection(cmdlet, outputObjectCollection); if (UnitTestMode) { UnitTestOutput.CheckInitialized(); UnitTestOutput.StartAddingOutput(); } // 20121117 //for (int i = 0; i < outputObjectCollection.Count; i++) { foreach (var item in outputObjectCollection) { writeSingleObject(cmdlet, item); } //} AfterWriteCollection(cmdlet, outputObjectCollection); }
public void WriteError(PSCmdletBase cmdlet, string message, string errorId, ErrorCategory category, bool terminating) { if (UnitTestMode) { UnitTestOutput.CheckInitialized(); UnitTestOutput.StartAddingOutput(); } var err = new ErrorRecord( new Exception(message), errorId, category, null); err.ErrorDetails = new ErrorDetails(message); //WriteError(cmdlet, err, terminating); writeSingleError(cmdlet, err, terminating); }