Get-Verb
PowerShell의 승인된 동사를 가져옵니다.
구문
Default (기본값)
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에서 도입되었습니다.
매개 변수 속성
| 형식: | String[] |
| Default value: | All groups |
| 허용되는 값: | Common, Communications, Data, Diagnostic, Lifecycle, Other, Security |
| 와일드카드 지원: | False |
| DontShow: | False |
매개 변수 집합
(All)
| Position: | 1 |
| 필수: | False |
| 파이프라인의 값: | True |
| 속성 이름별 파이프라인의 값: | True |
| 나머지 인수의 값: | False |
-Verb
지정된 동사만 가져옵니다. 동사의 이름 또는 이름 패턴을 입력합니다. 와일드카드가 허용됩니다.
매개 변수 속성
| 형식: | String[] |
| Default value: | All verbs |
| 와일드카드 지원: | True |
| DontShow: | False |
매개 변수 집합
(All)
| Position: | 0 |
| 필수: | False |
| 파이프라인의 값: | True |
| 속성 이름별 파이프라인의 값: | True |
| 나머지 인수의 값: | False |
CommonParameters
이 cmdlet은 일반적인 매개 변수인 -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction 및 -WarningVariable 매개 변수를 지원합니다. 자세한 내용은 about_CommonParameters를 참조하세요.
입력
None
개체를 이 cmdlet에 파이프로 연결할 수 없습니다.
출력
VerbInfo
참고
PowerShell 동사는 가장 일반적인 용도에 따라 그룹에 할당됩니다. 그룹은 동사를 쉽게 찾고 비교할 수 있도록 설계되었으며 사용을 제한하지 않습니다. 모든 유형의 명령에 승인된 동사를 사용할 수 있습니다.
각 PowerShell 동사는 다음 그룹 중 하나에 할당됩니다.
- 공통: 추가와 같은 거의 모든 cmdlet에 적용할 수 있는 제네릭 작업을 정의합니다.
- 통신: Connect와 같은 통신에 적용되는 작업을 정의합니다.
- 데이터: 백업과 같은 데이터 처리에 적용되는 작업을 정의합니다.
- 진단: 디버그와 같은 진단에 적용되는 작업을 정의합니다.
- 수명 주기: 완료와 같은 cmdlet의 수명 주기에 적용되는 작업을 정의합니다.
- 보안: 보안에 적용되는 작업(예: Revoke)을 정의합니다.
- 기타: 다른 유형의 작업을 정의합니다.
powerShell과 함께 설치된 cmdlet 중 일부(예: Tee-Object 및 Where-Object)는 승인되지 않은 동사를 사용합니다. 이러한 cmdlet은 역사적 예외이며, 동사는 로 예약된로 분류됩니다.