Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

powershell equivalent to get-argumentcompleter

Register-ArgumentCompleter is an incredibly useful function but I have a suspicion that overzealous use of it by some modules has caused my shell to slow down. I would like to see a list of all the ArgumentCompleters that are Registered in my Session.

I had an idea for how to write one, but it is overly complex and I have my doubts it would work, so if anyone knows of a solution already I would greatly appreciate it.

like image 601
ehiller Avatar asked Mar 14 '26 18:03

ehiller


1 Answers

Have a look at the module ImpliedReflection

You can then use this line to read the argument completers. To access with without the ImpliedReflection module, use standard .net reflection.

$ExecutionContext._invokeCommand._context.CustomArgumentCompleters.Keys

like image 173
Raimund Andree Avatar answered Mar 16 '26 10:03

Raimund Andree



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!