Skip to content

Commit 372e7a0

Browse files
committed
update monitor cmdlet warning message
1 parent f9346f9 commit 372e7a0

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/Monitor/Monitor/MonitorCmdletBase.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,19 @@ protected void WriteIdentifiedWarning(string cmdletName, string topic, string me
6767
topic,
6868
message);
6969

70-
if (withTimeStamp)
71-
{
72-
WriteWarningWithTimestamp(formattedMessage);
73-
}
74-
else
70+
string supressWarningOrErrorValue = System.Environment.GetEnvironmentVariable(BreakingChangeAttributeHelper.SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME);
71+
bool supressWarningOrError;
72+
Boolean.TryParse(supressWarningOrErrorValue, out supressWarningOrError);
73+
if (!supressWarningOrError)
7574
{
76-
WriteWarning(formattedMessage);
75+
if (withTimeStamp)
76+
{
77+
WriteWarningWithTimestamp(formattedMessage);
78+
}
79+
else
80+
{
81+
WriteWarning(formattedMessage);
82+
}
7783
}
7884
}
7985

0 commit comments

Comments
 (0)