Skip to content

Commit ba7d01a

Browse files
authored
Fix false positive of AvoidAlias rule for implicit aliasing of Get- commands for the CommandType ExternalScript (#1386)
* Fix false positive of AvoidAlias rule for implicit aliasing of Get- commands for the CommandType ExternalScript * retrigger ci
1 parent fd885f9 commit ba7d01a

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
@@ -136,7 +136,8 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
136136
}
137137

138138
var commdNameWithGetPrefix = $"Get-{commandName}";
139-
var cmdletNameIfCommandWasMissingGetPrefix = Helper.Instance.GetCommandInfo(commdNameWithGetPrefix);
139+
var cmdletNameIfCommandWasMissingGetPrefix = Helper.Instance.GetCommandInfo(name: commdNameWithGetPrefix,
140+
commandType: CommandTypes.Cmdlet | CommandTypes.Function | CommandTypes.Script);
140141
if (cmdletNameIfCommandWasMissingGetPrefix != null)
141142
{
142143
yield return new DiagnosticRecord(

0 commit comments

Comments
 (0)