How to find Commands that have the Specified Parameter

by Jun 15, 2015

Get-Command is your primary tool when you need to find a command to accomplish something.

You can search for verbs and/or nouns like this:

# find all cmdlets/functions that stop things
Get-Command -Verb Stop
# find all cmdlets/functions that affect services
Get-Command -Noun Service

Beginning in PowerShell 3.0, Get-Command can also find cmdlets or functions with a given parameter:

# new in PS3 and better
# find all cmdlets/functions with a -ComputerName parameter
Get-Command -ParameterName ComputerName

Note that Get-Command searches the loaded cmdlets/functions. Make sure you imported the modules that you want to be covered before you start your search.

Twitter This Tip! ReTweet this Tip!