diff --git a/Rules/AvoidAlias.cs b/Rules/AvoidAlias.cs index dd488527f..c30de8db2 100644 --- a/Rules/AvoidAlias.cs +++ b/Rules/AvoidAlias.cs @@ -136,7 +136,8 @@ public IEnumerable 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(