1

#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
Filed in: Columns, Tips and Tricks Tags: ,
© 2018 PowerShell Magazine. All rights reserved. XHTML / CSS Valid.
Proudly designed by Theme Junkie.
%d bloggers like this: