PowerTip: Use PowerShell to Find Things to Get


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*

Comments (4)

  1. Maffiow says:

    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

  2. James Brown says:

    Hmm…. Not a single result from the three examples given. Must be a PS 4.0 thing.

  3. Ed Wilson says:

    @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…

Skip to main content