From ceac5a39d9bd90e6c8b47a1cb468d41a244b718f Mon Sep 17 00:00:00 2001 From: msJinLei Date: Thu, 6 Feb 2020 18:59:28 +0800 Subject: [PATCH] Display Survey url in Resolve-AzError issue: https://github.com/Azure/azure-powershell/issues/11021 --- src/Accounts/Accounts/ChangeLog.md | 1 + src/Accounts/Accounts/Common/AzureProfileConstants.cs | 2 ++ src/Accounts/Accounts/Errors/ResolveError.cs | 4 ++++ src/Accounts/Accounts/Properties/Resources.Designer.cs | 9 +++++++++ src/Accounts/Accounts/Properties/Resources.resx | 3 +++ 5 files changed, 19 insertions(+) diff --git a/src/Accounts/Accounts/ChangeLog.md b/src/Accounts/Accounts/ChangeLog.md index dbc141e44e5f..8c9f6897a3f1 100644 --- a/src/Accounts/Accounts/ChangeLog.md +++ b/src/Accounts/Accounts/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Display AzurePowershell survey url to Resolve-Error. ## Version 1.7.1 * Disable context auto saving when AzureRmContext.json not available diff --git a/src/Accounts/Accounts/Common/AzureProfileConstants.cs b/src/Accounts/Accounts/Common/AzureProfileConstants.cs index 06ec207a0f5a..1eb8c01e8945 100644 --- a/src/Accounts/Accounts/Common/AzureProfileConstants.cs +++ b/src/Accounts/Accounts/Common/AzureProfileConstants.cs @@ -23,5 +23,7 @@ namespace Microsoft.Azure.Commands.Profile.Common public static class AzureProfileConstants { public const string AzureAutosaveVariable = "Azure_Profile_Autosave"; + + public const string AzureSurveyUrl = "https://aka.ms/azpssurvey"; } } diff --git a/src/Accounts/Accounts/Errors/ResolveError.cs b/src/Accounts/Accounts/Errors/ResolveError.cs index 7045177eda13..af66a6bae7b8 100644 --- a/src/Accounts/Accounts/Errors/ResolveError.cs +++ b/src/Accounts/Accounts/Errors/ResolveError.cs @@ -17,6 +17,8 @@ using System.Linq; using System.Management.Automation; using Microsoft.Azure.Commands.Common.Authentication.Abstractions; +using Microsoft.Azure.Commands.Profile.Common; +using Microsoft.Azure.Commands.Profile.Properties; using System.Collections; using Microsoft.Azure.Commands.ResourceManager.Common; using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; @@ -79,6 +81,8 @@ public override void ExecuteCmdlet() HandleError(record); } } + var message = string.Format(Resources.AzurePowerShellFeedback, AzureProfileConstants.AzureSurveyUrl); + Console.WriteLine(message); } private IEnumerable GetErrorVariable() diff --git a/src/Accounts/Accounts/Properties/Resources.Designer.cs b/src/Accounts/Accounts/Properties/Resources.Designer.cs index 439ce8096b60..163608a2b423 100644 --- a/src/Accounts/Accounts/Properties/Resources.Designer.cs +++ b/src/Accounts/Accounts/Properties/Resources.Designer.cs @@ -158,6 +158,15 @@ internal static string AutosaveSettingFromSession { return ResourceManager.GetString("AutosaveSettingFromSession", resourceCulture); } } + + /// + /// Looks up a localized string similar to The Azure PowerShell team is listening, please let us know how we are doing: {0}.. + /// + internal static string AzurePowerShellFeedback { + get { + return ResourceManager.GetString("AzurePowerShellFeedback", resourceCulture); + } + } /// /// Looks up a localized string similar to Selected profile must not be null.. diff --git a/src/Accounts/Accounts/Properties/Resources.resx b/src/Accounts/Accounts/Properties/Resources.resx index dffd4705ec32..488f2a78e9ce 100644 --- a/src/Accounts/Accounts/Properties/Resources.resx +++ b/src/Accounts/Accounts/Properties/Resources.resx @@ -471,4 +471,7 @@ Fail to access profile file and will try to use process ContextAutosaveSetting mode. Detailed error: '{0}' + + The Azure PowerShell team is listening, please let us know how we are doing: {0}. + \ No newline at end of file