From 3c16eae3313916be5dbea470fdcb8b088ee1b15f Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Thu, 2 Jan 2020 21:58:20 +0000 Subject: [PATCH 1/2] Fix false positive of AvoidAlias rule for implicit aliasing of Get- commands for the CommandType ExternalScript --- Rules/AvoidAlias.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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( From fdd7bbe41d77e1f6243771650d0ec947c449f153 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Thu, 2 Jan 2020 22:20:43 +0000 Subject: [PATCH 2/2] retrigger ci