Share via


Get-Verb

승인된 PowerShell 동사를 가져옵니다.

Syntax

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

Description

함수는 Get-Verb PowerShell 명령에서 사용하도록 승인된 동사를 가져옵니다.

PowerShell cmdlet 및 함수 이름에는 형식이 Verb-Noun 있고 승인된 동사를 포함하는 것이 좋습니다. 이 방법을 사용하면 명령 이름을 보다 일관되고 예측 가능하며 사용하기 쉽습니다.

승인되지 않은 동사를 사용하는 명령은 여전히 PowerShell에서 실행됩니다. 그러나 이름 Import-Module 에 승인되지 않은 동사가 있는 명령이 포함된 모듈을 가져오면 명령에 경고 메시지가 표시됩니다.

참고 항목

반환되는 Get-Verb 동사 목록이 완료되지 않을 수 있습니다. 설명이 포함된 승인된 PowerShell 동사의 업데이트된 목록은 승인된 동사를 참조 하세요.

예제

예제 1 - 모든 동사 목록 가져오기

Get-Verb

예제 2 - "un"으로 시작하는 승인된 동사 목록 가져오기

Get-Verb un*

Verb       AliasPrefix Group     Description
----       ----------- -----     -----------
Undo       un          Common    Sets a resource to its previous state
Unlock     uk          Common    Releases a resource that was locked
Unpublish  ub          Data      Makes a resource unavailable to others
Uninstall  us          Lifecycle Removes a resource from an indicated location
Unregister ur          Lifecycle Removes the entry for a resource from a repository
Unblock    ul          Security  Removes restrictions to a resource
Unprotect  up          Security  Removes safeguards from a resource that were added to prevent it from attack or loss

예제 3 - 보안 그룹에서 승인된 모든 동사 가져오기

Get-Verb -Group Security

Verb      AliasPrefix Group    Description
----      ----------- -----    -----------
Block     bl          Security Restricts access to a resource
Grant     gr          Security Allows access to a resource
Protect   pt          Security Safeguards a resource from attack or loss
Revoke    rk          Security Specifies an action that does not allow access to a resource
Unblock   ul          Security Removes restrictions to a resource
Unprotect up          Security Removes safeguards from a resource that were added to prevent it from attack or loss

예제 4 - 승인되지 않은 동사가 있는 모듈의 모든 명령을 찾습니다.

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

매개 변수

-Group

지정된 그룹만 가져옵니다. 그룹의 이름을 입력합니다. 야생카드 허용되지 않습니다.

이 매개 변수는 PowerShell 6.0에서 도입되었습니다.

Type:String[]
Accepted values:Common, Communications, Data, Diagnostic, Lifecycle, Other, Security
Position:1
Default value:All groups
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Verb

지정된 동사만 가져옵니다. 동사의 이름 또는 이름 패턴을 입력합니다. 와일드카드 허용됩니다.

Type:String[]
Position:0
Default value:All verbs
Required:False
Accept pipeline input:True
Accept wildcard characters:True

입력

None

개체를 이 cmdlet으로 파이프할 수 없습니다.

출력

VerbInfo

참고

PowerShell 동사는 가장 일반적인 용도에 따라 그룹에 할당됩니다. 그룹은 동사의 용도를 제한하지 않으면서 쉽게 찾고 비교할 수 있게 합니다. 모든 유형의 명령에 승인된 동사를 사용할 수 있습니다.

각 PowerShell 동사는 다음 그룹 중 하나에 할당됩니다.

  • 공통: 추가와 같은 거의 모든 cmdlet에 적용할 수 있는 제네릭 작업을 정의합니다.
  • 통신: 커넥트 같은 통신에 적용되는 작업을 정의합니다.
  • 데이터: 백업과 같은 데이터 처리에 적용되는 작업을 정의합니다.
  • 진단: 디버그와 같은 진단 적용되는 작업을 정의합니다.
  • 수명 주기: 완료와 같은 cmdlet의 수명 주기에 적용되는 작업을 정의합니다.
  • 보안: 보안에 적용되는 작업(예: Revoke)을 정의합니다.
  • 기타: 다른 유형의 작업을 정의합니다.

PowerShell과 함께 설치된 cmdlet 중 일부(예: Tee-ObjectWhere-Object승인되지 않은 동사 사용). 이러한 cmdlet은 기록 예외이며 동사는 예약된 것으로 분류됩니다.