Skip to content

Commit ccb149a

Browse files
authored
Add new properties in the IOutputSanitizer (#425)
1 parent c4f1529 commit ccb149a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Common/AzurePSCmdlet.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,9 @@ protected void WriteSurvey()
548548

549549
private void SanitizeOutput(object sendToPipeline)
550550
{
551-
if (OutputSanitizer?.RequireSecretsDetection == true)
551+
if (OutputSanitizer != null && OutputSanitizer.RequireSecretsDetection
552+
&& !OutputSanitizer.IgnoredModules.Contains(MyInvocation?.MyCommand?.ModuleName)
553+
&& !OutputSanitizer.IgnoredCmdlets.Contains(MyInvocation?.MyCommand?.Name))
552554
{
553555
OutputSanitizer.Sanitize(sendToPipeline, out var telemetry);
554556
_qosEvent?.SanitizerInfo.Combine(telemetry);

src/Common/Sanitizer/IOutputSanitizer.cs

+6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using System.Collections.Generic;
16+
1517
namespace Microsoft.WindowsAzure.Commands.Common.Sanitizer
1618
{
1719
public interface IOutputSanitizer
1820
{
1921
bool RequireSecretsDetection { get; }
2022

23+
IEnumerable<string> IgnoredModules { get; }
24+
25+
IEnumerable<string> IgnoredCmdlets { get; }
26+
2127
void Sanitize(object sanitizingObject, out SanitizerTelemetry telemetryData);
2228
}
2329
}

0 commit comments

Comments
 (0)