Get-Verb

업데이트 날짜: 2014년 5월

적용 대상: Windows PowerShell 3.0, Windows PowerShell 4.0, Windows PowerShell 5.0

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

구문

Get-Verb [[-Verb] <string[]>] [<CommonParameters>]

설명

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

Windows PowerShell에서는 cmdlet 및 함수 이름이 동사-명사 형식을 가지며 승인된 동사를 포함할 것을 권장합니다. 이 방법을 사용하면 명령 이름이 보다 일관되고 예측 가능해지며, 방법 자체가 사용하기 쉽습니다. 이 방법은 첫 번째 언어로 영어를 사용하지 않는 사용자에게 특히 유용합니다.

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

참고: Get-Verb가 반환하는 동사 목록이 불완전할 수 있습니다. 승인된 Windows PowerShell 동사의 업데이트된 목록과 설명을 보려면 MSDN의 "Cmdlet 동사"(https://go.microsoft.com/fwlink/?LinkID=160773)(영문)를 참조하세요.

매개 변수

-Verb <string[]>

지정된 동사만 가져옵니다. 동사의 이름 또는 이름 패턴을 입력하세요. 와일드카드가 지원됩니다.

필수 여부

false

위치

1

기본값

모든 동사

파이프라인 입력 적용 여부

true (ByValue)

와일드카드 문자 허용 여부

true

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable, -Verbose, -WarningAction 및 -WarningVariable을 지원합니다. 자세한 내용은 about_CommonParameters를 참조하세요.

입력 및 출력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다. 반환 유형은 cmdlet에서 반환되는 개체의 유형입니다.

입력

없음

출력

Selected.Microsoft.PowerShell.Commands.MemberDefinition

참고

Get-Verb는 Microsoft.PowerShell.Commands.MemberDefinition 개체의 수정된 버전을 반환합니다. 이 개체에 MemberDefinition 개체의 표준 속성이 없습니다. 대신 이 개체는 Verb 및 Group 속성을 갖습니다. Verb 속성에는 동사 이름의 문자열이 포함됩니다. Group 속성에는 동사 그룹의 문자열이 포함됩니다.

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

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

-- 일반: 거의 모든 cmdlet에 적용될 수 있는 일반 작업을 정의합니다(예: Add).

-- 통신: 통신에 적용되는 작업을 정의합니다(예: Connect).

-- Data: 데이터 처리에 적용되는 작업을 정의합니다(예: Backup).

-- 진단: 진단에 적용되는 작업을 정의합니다(예: Debug).

-- 수명 주기: cmdlet의 수명 주기에 적용되는 동작을 정의합니다(예: Complete).

-- 보안: 보안에 적용되는 작업을 정의합니다(예: Revoke).

-- 기타: 다른 유형의 작업을 정의합니다.

Windows PowerShell과 함께 설치되는 일부 cmdlet(예: Tee-ObjectWhere-Object)은 승인되지 않은 동사를 사용합니다. 이러한 cmdlet은 기록 예외로 간주되고 해당 동사는 "예약됨"으로 분류됩니다.

예제 1

C:\PS>get-verb

Description
-----------
This command gets all approved verbs.





예제 2

C:\PS>get-verb un*

Verb                 Group
----                 -----
Undo                 Common
Unlock               Common
Unpublish            Data
Uninstall            Lifecycle
Unregister           Lifecycle
Unblock              Security
Unprotect            Security

Description
-----------
This command gets all approved verbs that begin with "un".





예제 3

C:\PS>get-verb | where-object {$_.Group -eq "Security"}

Verb                 Group
----                 -----
Block                Security
Grant                Security
Protect              Security
Revoke               Security
Unblock              Security
Unprotect            Security

Description
-----------
This command gets all approved verbs in the Security group.





예제 4

C:\PS>get-command -module MyModule | where { (get-verb $_.Verb) -eq $null }

Description
-----------
This command finds all commands in a module that have unapproved verbs.





예제 5

C:\PS>$approvedVerbs = get-verb | foreach {$_.verb}

C:\PS> $myVerbs = get-command -module MyModule | foreach {$_.verb}

# Does MyModule export functions with unapproved verbs?
C:\PS> ($myVerbs | foreach {$approvedVerbs -contains $_}) -contains $false
True

# Which unapproved verbs are used in MyModule?
C:\PS>  ($myverbs | where {$approvedVerbs -notcontains $_})
ForEach
Sort
Tee
Where

Description
-----------
These commands detect unapproved verbs in a module and tell which unapproved verbs were detected in the module.





See Also

Other Resources

Import-Module