May 19th, 2014

PowerTip: Use PowerShell to Find Things to Get

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to find commands that “get” stuff.

Hey, Scripting Guy! Question How can I find Windows PowerShell commands that can find stuff about disks or other Windows components?

Hey, Scripting Guy! Answer Use the Get-Command cmdlet, specify the verb as Get, and then use wildcard characters to specify the noun.
          (In the following examples, GCM is an alias for the Get-Command cmdlet).

To find cmdlets that return information about disks:

gcm -verb get -noun *disk*

To find cmdlets that return information about networks:

gcm -verb get -noun *network*

To find cmdlets that return information about DNS:

gcm -verb get -noun *dns*

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.