/// <summary>
 /// Helper method to set the WriteStreamType property
 /// based on note properties of a PSObject object.
 /// </summary>
 /// <param name="so">PSObject.</param>
 internal void SetStreamTypeFromPSObject(
     System.Management.Automation.PSObject so)
 {
     if (PSObjectHelper.IsWriteErrorStream(so))
     {
         writeStream = WriteStreamType.Error;
     }
     else if (PSObjectHelper.IsWriteWarningStream(so))
     {
         writeStream = WriteStreamType.Warning;
     }
     else if (PSObjectHelper.IsWriteVerboseStream(so))
     {
         writeStream = WriteStreamType.Verbose;
     }
     else if (PSObjectHelper.IsWriteDebugStream(so))
     {
         writeStream = WriteStreamType.Debug;
     }
     else if (PSObjectHelper.IsWriteInformationStream(so))
     {
         writeStream = WriteStreamType.Information;
     }
     else
     {
         writeStream = WriteStreamType.None;
     }
 }
예제 #2
0
 internal void SetStreamTypeFromPSObject(PSObject so)
 {
     if (PSObjectHelper.IsWriteErrorStream(so))
     {
         this.writeStream = WriteStreamType.Error;
     }
     else if (PSObjectHelper.IsWriteWarningStream(so))
     {
         this.writeStream = WriteStreamType.Warning;
     }
     else if (PSObjectHelper.IsWriteVerboseStream(so))
     {
         this.writeStream = WriteStreamType.Verbose;
     }
     else if (PSObjectHelper.IsWriteDebugStream(so))
     {
         this.writeStream = WriteStreamType.Debug;
     }
     else
     {
         this.writeStream = WriteStreamType.None;
     }
 }