diff --git a/.globalconfig b/.globalconfig index 7f8beba3a70..0a77ac59fd3 100644 --- a/.globalconfig +++ b/.globalconfig @@ -181,8 +181,8 @@ dotnet_diagnostic.CA1065.severity = warning dotnet_diagnostic.CA1066.severity = none # CA1067: Override Object.Equals(object) when implementing IEquatable -# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1067 -dotnet_diagnostic.CA1067.severity = suggestion +# # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1067 +dotnet_diagnostic.CA1067.severity = warning # CA1068: CancellationToken parameters must come last # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1068 diff --git a/src/System.Management.Automation/engine/EventManager.cs b/src/System.Management.Automation/engine/EventManager.cs index fd30298669e..3df9153f4e7 100644 --- a/src/System.Management.Automation/engine/EventManager.cs +++ b/src/System.Management.Automation/engine/EventManager.cs @@ -2042,6 +2042,19 @@ private ScriptBlock CreateBoundScriptBlock(ScriptBlock scriptAction) #region IComparable Members + /// + /// Determines whether the specified object is equal to the current object. + /// + /// The object to compare with the current object. + /// + /// if the specified object is equal to the current object; + /// otherwise, . + /// + public override bool Equals(object obj) + { + return obj is PSEventSubscriber es && Equals(es); + } + /// /// Determines if two PSEventSubscriber instances are equal ///