Skip to content

Commit

Permalink
Fix false positive of AvoidAlias rule for implicit aliasing of Get- c…
Browse files Browse the repository at this point in the history
…ommands for the CommandType ExternalScript (#1386)

* Fix false positive of AvoidAlias rule for implicit aliasing of Get- commands for the CommandType ExternalScript

* retrigger ci
  • Loading branch information
bergmeister authored Jan 28, 2020
1 parent fd885f9 commit ba7d01a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Rules/AvoidAlias.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
}

var commdNameWithGetPrefix = $"Get-{commandName}";
var cmdletNameIfCommandWasMissingGetPrefix = Helper.Instance.GetCommandInfo(commdNameWithGetPrefix);
var cmdletNameIfCommandWasMissingGetPrefix = Helper.Instance.GetCommandInfo(name: commdNameWithGetPrefix,
commandType: CommandTypes.Cmdlet | CommandTypes.Function | CommandTypes.Script);
if (cmdletNameIfCommandWasMissingGetPrefix != null)
{
yield return new DiagnosticRecord(
Expand Down

0 comments on commit ba7d01a

Please sign in to comment.