Skip to content

Conversation

@AndyBodnar
Copy link

PR Summary

Hey, this adds the Get-ArgumentCompleter and Unregister-ArgumentCompleter cmdlets that were discussed in #25800. The WG approved adding these back in October 2025 and I noticed the issue was still open, so I figured I'd take a crack at it.

Right now if you register argument completers, there's no way to see what's registered or remove them without restarting your session (or using the null trick with Register-ArgumentCompleter). These two cmdlets fix that.

Get-ArgumentCompleter lets you see all the registered completers. You can filter by command name, parameter name, or use the -Native switch to see native command completers. Wildcards work too, so you can do stuff like Get-ArgumentCompleter -CommandName "Get-*" to find completers for all Get commands.

Unregister-ArgumentCompleter removes completers. I matched the parameter sets to Register-ArgumentCompleter so they feel consistent. You can unregister by command+parameter for PowerShell completers, by command name for native completers, or use -NativeFallback to remove the fallback completer.

I also added an ArgumentCompleterInfo class that Get-ArgumentCompleter returns, and an ArgumentCompleterType enum so you can easily tell if something is a PowerShell completer, native completer, or the native fallback.

PR Context

Fixes #25800

PR Checklist

This change adds two new cmdlets to complement the existing Register-ArgumentCompleter cmdlet:

- Get-ArgumentCompleter: Returns registered argument completers with filtering support for command name, parameter name, and native vs PowerShell completers. Supports wildcards.

- Unregister-ArgumentCompleter: Removes registered argument completers. Mirrors the parameter sets of Register-ArgumentCompleter for consistency.

Also adds ArgumentCompleterInfo class and ArgumentCompleterType enum to expose completer information, and includes tests for the new cmdlets.

Fixes PowerShell#25800
@AndyBodnar AndyBodnar requested a review from a team as a code owner January 11, 2026 21:20
@iSazonov
Copy link
Collaborator

Some thoughts.
We have the opportunity to register one completer for several cmdlets. I would expect that the new cmdlets are more focused on completers.
For example, get a list of all the completers and their corresponding list of commands; for a given cmdlet, show the completer and all the commands to which it is linked.
This is the same approach I would expect from unregistering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider adding Get-ArgumentCompleter and Unregister-ArgumentCompleter for custom completer management

2 participants