From 1651db0c4d62a5ba9cd70cd0a974f19ea501fab4 Mon Sep 17 00:00:00 2001 From: Koji Ishii Date: Tue, 19 May 2026 23:19:02 +0900 Subject: [PATCH] feat(ps): ps completion supports aliases Aliases to `task`, `task.exe`, `path\to\task`, and `path\to\task.exe` are supported, as long as they are set beforehand. Fixes #2851. --- completion/ps/task.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/completion/ps/task.ps1 b/completion/ps/task.ps1 index 05cadb5881..71b58b88f1 100644 --- a/completion/ps/task.ps1 +++ b/completion/ps/task.ps1 @@ -1,6 +1,8 @@ using namespace System.Management.Automation -Register-ArgumentCompleter -CommandName task -ScriptBlock { +$cmdNames = @('task') + (Get-Alias -Definition task,task.exe,*\task,*\task.exe -ErrorAction SilentlyContinue).Name | Select-Object -Unique + +Register-ArgumentCompleter -CommandName $cmdNames -ScriptBlock { param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) if ($commandName.StartsWith('-')) {