diff --git a/Rules/AvoidUsingPlainTextForPassword.cs b/Rules/AvoidUsingPlainTextForPassword.cs index 4e6366bff..4a69c6812 100644 --- a/Rules/AvoidUsingPlainTextForPassword.cs +++ b/Rules/AvoidUsingPlainTextForPassword.cs @@ -55,8 +55,8 @@ public IEnumerable AnalyzeScript(Ast ast, string fileName) } } - if (hasPwd && (!paramType.IsArray && (paramType == typeof(String) || paramType == typeof(object))) - || (paramType.IsArray && (paramType.GetElementType() == typeof(String) || paramType.GetElementType() == typeof(object)))) + if (hasPwd && ((!paramType.IsArray && (paramType == typeof(String) || paramType == typeof(object))) + || (paramType.IsArray && (paramType.GetElementType() == typeof(String) || paramType.GetElementType() == typeof(object))))) { yield return new DiagnosticRecord( String.Format(CultureInfo.CurrentCulture, Strings.AvoidUsingPlainTextForPasswordError, paramAst.Name), diff --git a/Tests/Rules/AvoidUsingPlainTextForPasswordNoViolations.ps1 b/Tests/Rules/AvoidUsingPlainTextForPasswordNoViolations.ps1 index 3203dc0f4..0de5015ac 100644 --- a/Tests/Rules/AvoidUsingPlainTextForPasswordNoViolations.ps1 +++ b/Tests/Rules/AvoidUsingPlainTextForPasswordNoViolations.ps1 @@ -26,7 +26,9 @@ [securestring] $passwordparam, [string] - $PassThru + $PassThru, + [string[]] + $shouldnotraiseerror ) Begin