Skip to content

Commit b050102

Browse files
author
Kapil Borle
committed
Compare whitelisted aliases in a case-insensitive manner
1 parent 95e9287 commit b050102

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Rules/AvoidAlias.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using System.ComponentModel.Composition;
1919
#endif
2020
using System.Globalization;
21+
using System.Linq;
2122

2223
namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules
2324
{
@@ -119,7 +120,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
119120
// You can also review the remark section in following document,
120121
// MSDN: CommandAst.GetCommandName Method
121122
if (aliasName == null
122-
|| whiteList.Contains(aliasName))
123+
|| whiteList.Contains<string>(aliasName, StringComparer.OrdinalIgnoreCase))
123124
{
124125
continue;
125126
}

0 commit comments

Comments
 (0)