PowerShell / PowerShell/PowerShell

Get-Command can't resolve commands entered by omitting the Get-* verb, though command discovery can

未关闭
#17,438 11 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

In-PR Issue-Enhancement KeepOpen WG-Cmdlets WG-Reviewed
主要语言
C#
星标
55.5k
派生
8.5k
平均合并
1 天 2 小时
30 天内合并 PR
88

描述

Summary of the new feature / enhancement

As a user, I would expect Get-Command to mirror command discovery; if I can invoke a command (e.g., uptime) then I should be able to find the command pwsh is invoking with Get-Command.

However, Get-Command uptime returns no results, despite simply calling uptime ending up finding and calling Get-Uptime.

Proposed technical implementation details (optional)

Get-Command should implement the same fallback behaviour used in command discovery; if no results are found and the command contains no verb, the Get- verb should be prepended to try to find the command in the same way command discovery normally would find the command.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 Get-Command 和命令发现路径入手,比较它们各自如何处理像 uptime 这样的不带动词的名称。完成的标准是:Get-Command uptime 解析出与调用 uptime 时相同的 Get-Uptime 命令,同时现有的带动词限定的查找仍然有效。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp, powershell
领域
cli
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
68/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。