diff --git a/src/Common/CustomAttributes/BreakingChangeAttributeHelper.cs b/src/Common/CustomAttributes/BreakingChangeAttributeHelper.cs index e1f7c0f777..f9a420de15 100644 --- a/src/Common/CustomAttributes/BreakingChangeAttributeHelper.cs +++ b/src/Common/CustomAttributes/BreakingChangeAttributeHelper.cs @@ -98,17 +98,21 @@ public static void ProcessCustomAttributesAtRuntime(Type type, InvocationInfo in } List attributes = new List(GetAllBreakingChangeAttributesInType(type, invocationInfo)); + StringBuilder sb = new StringBuilder(); + Action appendBreakingChangeInfo = (string s) => sb.Append(s); if (attributes != null && attributes.Count > 0) { - writeOutput(string.Format(Resources.BreakingChangesAttributesHeaderMessage, Utilities.GetNameFromCmdletType(type))); + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesHeaderMessage, Utilities.GetNameFromCmdletType(type))); foreach (GenericBreakingChangeAttribute attribute in attributes) { - attribute.PrintCustomAttributeInfo(type, false, writeOutput); + attribute.PrintCustomAttributeInfo(type, false, appendBreakingChangeInfo); } - writeOutput(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + + writeOutput(sb.ToString()); } }