Add Get-ArgumentCompleter and Unregister-ArgumentCompleter cmdlets #26680
+432
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header