Movatterモバイル変換


[0]ホーム

URL:


Skip to main contentSkip to in-page navigation

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit focus mode

Get-Verb

    Gets approved PowerShell verbs.

    Syntax

    Default (Default)

    Get-Verb    [[-verb] <String[]>]    [<CommonParameters>]

    Description

    TheGet-Verb function gets verbs that are approved for use in PowerShell commands.

    PowerShell recommends cmdlet and function names have the Verb-Noun format and include an approvedverb. This practice makes command names more consistent, predictable, and easier to use.

    Commands that use unapproved verbs run in PowerShell. However, when you import a module thatincludes a command with an unapproved verb in its name, theImport-Module command displays awarning message.

    Note

    The verb list thatGet-Verb returns might not be complete. For an updated list of approvedPowerShell verbs with descriptions, seeApproved Verbs.

    Examples

    Example 1 - Get a list of all verbs

    Get-Verb

    Example 2 - Get a list of approved verbs that begin with "un"

    Get-Verb un*
    Verb                 Group----                 -----Undo                 CommonUnlock               CommonUnpublish            DataUninstall            LifecycleUnregister           LifecycleUnblock              SecurityUnprotect            Security

    Example 3 - Get all approved verbs in the Security group

    Get-Verb | Where-Object Group -EQ Security
    Verb      Group----      -----Block     SecurityGrant     SecurityProtect   SecurityRevoke    SecurityUnblock   SecurityUnprotect Security

    Example 4 - Finds all commands in a module that have unapproved verbs

    Get-Command -Module Microsoft.PowerShell.Utility | Where-Object Verb -NotIn (Get-Verb).Verb
    CommandType     Name            Version    Source-----------     ----            -------    ------Cmdlet          Sort-Object     3.1.0.0    Microsoft.PowerShell.UtilityCmdlet          Tee-Object      3.1.0.0    Microsoft.PowerShell.Utility

    Parameters

    -Verb

    Gets only the specified verbs. Enter the name of a verb or a name pattern. Wildcards are allowed.

    Parameter properties

    Type:

    String[]

    Default value:All verbs
    Supports wildcards:True
    DontShow:False

    Parameter sets

    (All)
    Position:1
    Mandatory:False
    Value from pipeline:True
    Value from pipeline by property name:False
    Value from remaining arguments:False

    CommonParameters

    This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, seeabout_CommonParameters.

    Inputs

    None

    Outputs

    Selected.Microsoft.PowerShell.Commands.MemberDefinition

    Notes

    Get-Verb returns a modified version of aMicrosoft.PowerShell.Commands.MemberDefinitionobject. The object doesn't have the standard properties of aMemberDefinition object. Instead ithasVerb andGroup properties. TheVerb property contains a string with the verb name.TheGroup property contains a string with the verb group.

    PowerShell verbs are assigned to a group based on their most common use. The groups are designed tomake the verbs easy to find and compare, not to restrict their use. You can use any approved verbfor any type of command.

    Each PowerShell verb is assigned to one of the following groups.

    • Common: Define generic actions that can apply to almost any cmdlet, such as Add.
    • Communications: Define actions that apply to communications, such as Connect.
    • Data: Define actions that apply to data handling, such as Backup.
    • Diagnostic: Define actions that apply to diagnostics, such as Debug.
    • Lifecycle: Define actions that apply to the lifecycle of a cmdlet, such as Complete.
    • Security: Define actions that apply to security, such as Revoke.
    • Other: Define other types of actions.

    Some of the cmdlets installed with PowerShell, such asTee-Object andWhere-Object, useunapproved verbs. These cmdlets are historic exceptions and their verbs are classified asreserved.

    Related Links

    Collaborate with us on GitHub
    The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

    Feedback

    Was this page helpful?

    YesNo

    In this article

    Was this page helpful?

    YesNo