#PSTip List all cmdlets with a specified parameter – The PowerShell 3.0 way!

In Windows PowerShell 2.0, if we had to list a complete list of cmdlets that had a specific parameter, we could have done it in a couple of different ways:

Get-Help * -Parameter ComputerName

or we can examine the cmdlet meta returned by Get-Command cmdlet!

Get-Command * | Where {$_.Definition -like "*-ComputerName*"}

In PowerShell 3.0, Get-Command cmdlet provides a simple way to do this.

Get-Command -ParameterName ComputerName

About the author: Ravikanth C

Ravikanth is the founder and editor of the PowerShell Magazine. He is also a PowerShell MVP who works at Dell Inc. He blogs at http://www.ravichaganti.com/blog and you can follow him on Twitter @ravikanth.

Related Posts