-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the bug that warning message cannot be suppressed #13005
Conversation
Fixed bug that always displayed warning Message when executing cmdlet based on MonitorCmdletBase
@@ -89,8 +89,12 @@ public override void ExecuteCmdlet() | |||
|
|||
try | |||
{ | |||
WriteWarningWithTimestamp("*** The namespace for all the model classes will change from Microsoft.Azure.Management.Monitor.Management.Models to Microsoft.Azure.Management.Monitor.Models in future releases."); | |||
WriteWarningWithTimestamp("*** The namespace for output classes will be uniform for all classes in future releases to make it independent of modifications in the model classes."); | |||
var isWarning = bool.Parse(System.Environment.GetEnvironmentVariable("SuppressAzurePowerShellBreakingChangeWarnings")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldSuppress is more accurate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will happen if Environment is not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test case is failed due to above reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it,thanks
src/Monitor/Monitor/ChangeLog.md
Outdated
@@ -20,6 +20,9 @@ | |||
|
|||
## Upcoming Release | |||
|
|||
## Version 2.1.1 | |||
* Fixed bug that always displayed warning Message when executing cmdlet based on MonitorCmdletBase [#12889] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion is
Fixed the bug that warning message cannot be suppressed. [#12889]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it
@@ -89,8 +89,12 @@ public override void ExecuteCmdlet() | |||
|
|||
try | |||
{ | |||
WriteWarningWithTimestamp("*** The namespace for all the model classes will change from Microsoft.Azure.Management.Monitor.Management.Models to Microsoft.Azure.Management.Monitor.Models in future releases."); | |||
WriteWarningWithTimestamp("*** The namespace for output classes will be uniform for all classes in future releases to make it independent of modifications in the model classes."); | |||
var isWarning = bool.Parse(System.Environment.GetEnvironmentVariable("SuppressAzurePowerShellBreakingChangeWarnings")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test case is failed due to above reason.
@@ -86,14 +86,22 @@ public override void ExecuteCmdlet() | |||
string reasonPhrase = null; | |||
string message = null; | |||
string exName = null; | |||
|
|||
string warningEnvironmentParam = "SuppressAzurePowerShellBreakingChangeWarnings"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it,thanks.
When will this be released ? |
Hi @cannehag , this fix is already included in the latest release of Monitor. Please install the latest Install-Module Az.Monitor -Repository PSGallery -Force |
@wyunchi-ms I did update and still got the warnings. But after a new test it did work just fine. Thank you! |
Please try to set |
It is working! I had to restart the PS session :) |
Description
Fixed bug that always displayed warning Message when executing cmdlet based on MonitorCmdletBase.
#12889
Checklist
CONTRIBUTING.md
ChangeLog.md
file(s) has been updated:ChangeLog.md
file can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
## Upcoming Release
header -- no new version header should be added