Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Make completer menus reusable #1818
Comments
|
For your comment (1), |
|
More sounds like the ask is to provide a PSReadLine cmdlet that allows users to invoke a MenuComplete (for F2) action for more general purposes, rather than just being a PSReadLine builtin functionality that is otherwise entirely inaccessible. |
|
Right, but that depends on the PSReadLine module to be available, which may not be the case for a custom PowerShell host. So a module cannot use that to replace the |
PowerShell scripts and modules can and do frequently take dependencies on (particular versions of) Powershell modules, but rarely if ever rely on specific versions of the PowerShell host. I am suggesting that this should be a command available in the PSReadLine module which could be called by other modules or scripts which take a dependency on (a future version of) that module. Modules are versioned, and generally backward compatible (and PSReadLine is, specifically, installable even down to Windows PowerShell), and are in my opinion inherently the right shipping container for most functionality. |
|
Perhaps it'd be better if the UI functionality parts of PSRL is split out into a slightly more general-purpose module that can be used from PS and C# modules? That way, you could take a dependency on the UI portion without necessarily requiring PSRL itself to be loaded, and PSRL would just take that same dependency for the functionality it needs. |
|
I don't think that's necessary, but I wouldn't argue against it. Remember though, that interactive "custom PowerShell hosts" that don't ship and depend on PSReadLine are purely hypothetical in nature. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Regarding the existing
MenuCompletefunction (Ctrl+Space) and the new "F2" history menu, a couple of requests:$Host.UI.PromptForChoiceis so hard to use ...MenuCompletecompleter shows the full syntax block for commands):