2

In the past week I have been looking at some Powershell best practices. One of these is to re-use Powershell parameter names so commands feel more intuitive.

Does anyone have a function for retrieving parameter names for all functions?

2 Answers 2

5

You can use the Get-Command cmdlet to retrieve all commands and select the parameter names:

get-command | % { if ($_.Parameters) {$_.Parameters.Keys }} | select -Unique | sort
Sign up to request clarification or add additional context in comments.

Comments

0

jisaak's post will get you a list of commands as requested; the best practices I read recommended re-using the Powershell verbs which you can get by:

Get-Verb

Modules containing modules that don't use the standard verbs generate a nice error:

WARNING: The names of some imported commands from the module '***' include
unapproved verbs that might make them less discoverable.
To find the commands with unapproved verbs, run the Import-Module command again
with the Verbose parameter. For a list of approved verbs, type Get-Verb.

1 Comment

Microsoft has a list of approved verbs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.