diff --git a/cmd/carapace/cmd/lazyinit/powershell.go b/cmd/carapace/cmd/lazyinit/powershell.go index ea8750b50e..0170a5e464 100644 --- a/cmd/carapace/cmd/lazyinit/powershell.go +++ b/cmd/carapace/cmd/lazyinit/powershell.go @@ -11,7 +11,7 @@ func Powershell(completers []string) string { $_carapace_lazy = { param($wordToComplete, $commandAst, $cursorPosition) - $completer = $commandAst.CommandElements[0].Value.trimend(".exe") + $completer = $commandAst.CommandElements[0].Value.Replace("\.exe$", "") carapace $completer powershell | Out-String | Invoke-Expression & (Get-Item "Function:_${completer}_completer") $wordToComplete $commandAst $cursorPosition }