October 4th, 2013

PowerTip: Find Only PowerShell Cmdlets that Use “Get”

Doctor Scripto
Scripter

Summary: Find only Windows PowerShell cmdlets that use the verb “get.”

Hey, Scripting Guy! Question How can I find cmdlets in Windows PowerShell that use the verb “get” when the parameters –Verb and –CommandType are exclusive?

Hey, Scripting Guy! Answer Use Get-Command to find the –CommandType of the cmdlet, pipe the results to Where-Object,
          and look for a verb equal to Get:

get-command -CommandType cmdlet | where verb -eq get

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.