다음을 통해 공유


Get-Verb

Gets approved PowerShell verbs.

구문

Default (기본값)

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

Description

The Get-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 approved verb. 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 that includes a command with an unapproved verb in its name, the Import-Module command displays a warning message.

Note

The verb list that Get-Verb returns might not be complete. For an updated list of approved PowerShell verbs with descriptions, see Approved Verbs.

예제

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                 Common
Unlock               Common
Unpublish            Data
Uninstall            Lifecycle
Unregister           Lifecycle
Unblock              Security
Unprotect            Security

Example 3 - Get all approved verbs in the Security group

Get-Verb | Where-Object Group -EQ Security
Verb      Group
----      -----
Block     Security
Grant     Security
Protect   Security
Revoke    Security
Unblock   Security
Unprotect 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.Utility
Cmdlet          Tee-Object      3.1.0.0    Microsoft.PowerShell.Utility

매개 변수

-Verb

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

매개 변수 속성

형식:

String[]

Default value:All verbs
와일드카드 지원:True
DontShow:False

매개 변수 집합

(All)
Position:1
필수:False
파이프라인의 값:True
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

CommonParameters

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

입력

None

출력

Selected.Microsoft.PowerShell.Commands.MemberDefinition

참고

Get-Verb returns a modified version of a Microsoft.PowerShell.Commands.MemberDefinition object. The object doesn't have the standard properties of a MemberDefinition object. Instead it has Verb and Group properties. The Verb property contains a string with the verb name. The Group 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 to make the verbs easy to find and compare, not to restrict their use. You can use any approved verb for 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 as Tee-Object and Where-Object, use unapproved verbs. These cmdlets are historic exceptions and their verbs are classified as reserved.