/// <summary> /// Writes out a flattened AggregateException to the PS Console /// </summary> /// <param name="exception">The AggregateException to print</param> /// <param name="host">The host to print the exception information to, typically this.Host from a PSCmdlet.</param> internal static void WriteExceptions(AggregateException exception, PSHost host = null) { if (exception != null) { PSCommon.WriteExceptions(PSCommon.IterateAggregate(exception), host); } else { throw new ArgumentNullException("exception", "The exception cannot be null"); } }