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()); } } diff --git a/src/Common/CustomAttributes/CmdletParameterBreakingChangeAttribute.cs b/src/Common/CustomAttributes/CmdletParameterBreakingChangeAttribute.cs index f83c18b542..c0d39936df 100644 --- a/src/Common/CustomAttributes/CmdletParameterBreakingChangeAttribute.cs +++ b/src/Common/CustomAttributes/CmdletParameterBreakingChangeAttribute.cs @@ -83,7 +83,7 @@ protected override string GetAttributeSpecificMessage() //See if the type of the param is changing if (OldParamaterType != null && !string.IsNullOrWhiteSpace(NewParameterTypeName)) { - message.Append("\n" + string.Format(Resources.BreakingChangeAttributeParameterTypeChange, OldParamaterType.FullName, NewParameterTypeName)); + message.Append(string.Format(Resources.BreakingChangeAttributeParameterTypeChange, OldParamaterType.FullName, NewParameterTypeName)); } return message.ToString(); } diff --git a/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs b/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs index 09d6a7ce08..0df9648a92 100644 --- a/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs +++ b/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs @@ -129,6 +129,10 @@ public string GetBreakingChangeTextFromAttribute(Type type, bool withCmdletName) public void PrintCustomAttributeInfo(Type type, bool withCmdletName, Action writeOutput) { if (!withCmdletName) { + if (!GetAttributeSpecificMessage().StartsWith(Environment.NewLine)) + { + writeOutput(Environment.NewLine); + } writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); } else { diff --git a/src/Common/Properties/Resources.resx b/src/Common/Properties/Resources.resx index 47406987a7..e51f7cf324 100644 --- a/src/Common/Properties/Resources.resx +++ b/src/Common/Properties/Resources.resx @@ -1644,20 +1644,24 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can 0(string): methodType - The parameter : '{0}' is changing. + +- The parameter : '{0}' is changing. - The parameter : '{0}' is becoming mandatory. + +- The parameter : '{0}' is becoming mandatory. - The parameter : '{0}' is being replaced by parameter : '{1}'. + +- The parameter : '{0}' is being replaced by parameter : '{1}'. - The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. + +- The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. - Change description : {0} - + +- Change description : {0} The cmdlet is being deprecated. There will be no replacement for it. @@ -1666,42 +1670,39 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can The cmdlet '{0}' is replacing this cmdlet. - The output type is changing from the existing type :'{0}' to the new type :'{1}' + +- The output type is changing from the existing type :'{0}' to the new type :'{1}' - "The output type '{0}' is changing" + +- The output type '{0}' is changing -- The following properties are being added to the output type : - +- The following properties are being added to the output type : - - The following properties in the output type are being deprecated : - +- The following properties in the output type are being deprecated : - - {0} - - + {0} - - Cmdlet : '{0}' - - {1} - + +- Cmdlet : '{0}' + - {1} - Breaking changes in the cmdlet '{0}' : + Upcoming breaking changes in the cmdlet '{0}' : - Note : This change will take effect on '{0}' - + +- This change will take effect on '{0}' - Note :The change is expected to take effect from the version : '{0}' - - + +- The change is expected to take effect from the version : '{0}' ```powershell @@ -1711,24 +1712,27 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can # New {1} ``` - - Cmdlet invocation changes : - Old Way : {0} - New Way : {1} + +Cmdlet invocation changes : + Old Way : {0} + New Way : {1} - The output type '{0}' is being deprecated without a replacement. + +The output type '{0}' is being deprecated without a replacement. - The type of the parameter is changing from '{0}' to '{1}'. + +The type of the parameter is changing from '{0}' to '{1}'. - NOTE : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. + +Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. This cmdlet is in preview. The functionality may not be available in the selected subscription. - + \ No newline at end of file