-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding ParameterType support to Get-CommandWithParameter #18
Comments
No reason other than not having run across a need for it. Note that unlike Get-Command, the parameter name is required because completers don't currently work purely by the parameter type. From: Shay Levymailto:[email protected] Is there a reason why Get-CommandWithParameter doesn't support the ParameterType parameter? With regard to command parameters, currently, Get-CommandWithParameter allows filtering ParameterName only. Having ParameterType will enable another layer of filtering to the current filtering capabilities of the Get-CommandWithParameter function. — |
So, no plans to add it? |
Only if there is a definite need. From: Shay Levymailto:[email protected] So, no plans to add it? — |
Fair enough. |
Here's a good example why ParameterType should be added. Many modules (e.g such as AD,Exchange,SharePoint, etc) makes extensive use of the Identity parameter, to specify the object to operate on. When writing custom completers for a bunch of commands and for a specific parameter (e.g Identity) we use the Get-CommandWithParameter function along with the parameter name in question. That covers most cases and allows us to group those commands with a specific parameter name/verb/noun to narrow down the result. But it lacks flexibility/efficiency, especially when the Identity parameter is outside the group of commands grouped by the above. Let's take the AD commands as an example, there are 9 commands that supports the Identity parameter by the Having ParameterType solves it all and can help reduce the amount of completers needed for the job, and imo much safer to use. With a single query we can create completers for a specific type of parameter without having to worry, or rely, on the name of the command. |
+1 for adding -ParameterType for exactly the reason stated above |
Is there a reason why Get-CommandWithParameter doesn't support the ParameterType parameter?
With regard to command parameters, currently, Get-CommandWithParameter allows filtering ParameterName only. Having ParameterType will enable another layer of filtering to the current filtering capabilities of the Get-CommandWithParameter function.
The text was updated successfully, but these errors were encountered: