PowerTip: Use PowerShell to Find Things to Get

PowerTip: Use PowerShell to Find Things to Get

  • Comments 4
  • Likes

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*

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Hmm.... Not a single result from the three examples given. Must be a PS 4.0 thing.

  • @James Brown, not a PowerShell 4.0 thing, but a Windows 8,8.1 or Windows Server 2012, or 2012 R2 thing. They are the versions, right now, that have infrastructure for the DNS module, Network module, disk module etc...

  • thank you

  • gcm -verb get -noun *disk*

    CommandType Name ModuleName
    ----------- ---- ----------
    Cmdlet Get-ClusterAvailableDisk FailoverClusters


    gcm -verb get -noun *network*

    CommandType Name ModuleName
    ----------- ---- ----------
    Cmdlet Get-ClusterNetwork FailoverClusters
    Cmdlet Get-ClusterNetworkInterface FailoverClusters
    Cmdlet Get-NlbClusterNodeNetworkInterface NetworkLoadBalancingClusters

    gcm -verb get -noun *dns*

    returns blank

    I'm running PS 3.0