From 955cac7eb936e0b26d8f358086c2cc0f12d265ec Mon Sep 17 00:00:00 2001 From: Mavaddat Javid <5055400+mavaddat@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:48:03 -0400 Subject: [PATCH] ignore resolve errors --- powershell_completions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powershell_completions.go b/powershell_completions.go index d4a3c37..092912e 100644 --- a/powershell_completions.go +++ b/powershell_completions.go @@ -284,7 +284,7 @@ $available%[2]s = Get-Command -Name '%[1]s' -All -ErrorAction SilentlyContinue | # Enumerate extant aliases for %[1]s (already set by user) ${__%[2]sAliases} = @() foreach($__%[2]sCmd in $available%[2]s){ - $__%[2]sAliases += Get-Alias | Where-Object { $_.Definition -eq ($__%[2]sCmd | Resolve-Path) -or $_.Definition -eq (Get-Command -Name $__%[2]sCmd -ErrorAction SilentlyContinue).Definition } + $__%[2]sAliases += Get-Alias | Where-Object { $_.Definition -eq ($__%[2]sCmd | Resolve-Path -ErrorAction SilentlyContinue) -or $_.Definition -eq (Get-Command -Name $__%[2]sCmd -ErrorAction SilentlyContinue).Definition } } # Register args completer for all cmds and aliases [string[]]$joint%[2]snames = [array]$available%[2]s.Name + [array]${__%[2]sAliases}.Name + @('%[1]s')