

Doc AWS SDK 예제 GitHub 리포지토리에서 더 많은 SDK 예제를 사용할 수 있습니다. [AWS](https://github.com/awsdocs/aws-doc-sdk-examples) 

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Tools for PowerShell V5를 사용한 CodeCommit 예제
<a name="powershell_5_codecommit_code_examples"></a>

다음 코드 예제에서는 CodeCommit과 함께 AWS Tools for PowerShell V5를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.

*작업*은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 개별 서비스 함수를 직접적으로 호출하는 방법을 보여주며 관련 시나리오의 컨텍스트에 맞는 작업을 볼 수 있습니다.

각 예시에는 전체 소스 코드에 대한 링크가 포함되어 있으며, 여기에서 컨텍스트에 맞춰 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있습니다.

**Topics**
+ [작업](#actions)

## 작업
<a name="actions"></a>

### `Get-CCBranch`
<a name="codecommit_GetBranch_powershell_5_topic"></a>

다음 코드 예시는 `Get-CCBranch`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리의 지정된 브랜치에 대한 정보를 가져옵니다.**  

```
Get-CCBranch -RepositoryName MyDemoRepo -BranchName MyNewBranch
```
**출력:**  

```
BranchName                              CommitId
----------                              --------
MyNewBranch                             7763222d...561fc9c9
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBranch](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CCBranchList`
<a name="codecommit_ListBranches_powershell_5_topic"></a>

다음 코드 예시는 `Get-CCBranchList`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리의 브랜치 이름 목록을 가져옵니다.**  

```
Get-CCBranchList -RepositoryName MyDemoRepo
```
**출력:**  

```
master
MyNewBranch
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [ListBranches](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CCRepository`
<a name="codecommit_GetRepository_powershell_5_topic"></a>

다음 코드 예시는 `Get-CCRepository`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리에 대한 정보를 가져옵니다.**  

```
Get-CCRepository -RepositoryName MyDemoRepo
```
**출력:**  

```
AccountId             : 80398EXAMPLE
Arn                   : arn:aws:codecommit:us-east-1:80398EXAMPLE:MyDemoRepo
CloneUrlHttp          : https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
CloneUrlSsh           : ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
CreationDate          : 9/8/2015 3:21:33 PM
DefaultBranch         :
LastModifiedDate      : 9/8/2015 3:21:33 PM
RepositoryDescription : This is a repository for demonstration purposes.
RepositoryId          : c7d0d2b0-ce40-4303-b4c3-38529EXAMPLE
RepositoryName        : MyDemoRepo
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetRepository](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CCRepositoryBatch`
<a name="codecommit_BatchGetRepositories_powershell_5_topic"></a>

다음 코드 예시는 `Get-CCRepositoryBatch`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리 중 어떤 리포지토리를 찾을 수 있고 찾을 수 없는지 확인합니다.**  

```
Get-CCRepositoryBatch -RepositoryName MyDemoRepo, MyNewRepo, AMissingRepo
```
**출력:**  

```
Repositories                            RepositoriesNotFound
------------                            --------------------
{MyDemoRepo, MyNewRepo}                {AMissingRepo}
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [BatchGetRepositories](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-CCRepositoryList`
<a name="codecommit_ListRepositories_powershell_5_topic"></a>

다음 코드 예시는 `Get-CCRepositoryList`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 모든 리포지토리를 이름을 기준으로 오름차순으로 나열합니다.**  

```
Get-CCRepositoryList -Order Ascending -SortBy RepositoryName
```
**출력:**  

```
RepositoryId                            RepositoryName
------------                            --------------
c7d0d2b0-ce40-4303-b4c3-38529EXAMPLE    MyDemoRepo
05f30c66-e3e3-4f91-a0cd-1c84aEXAMPLE    MyNewRepo
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [ListRepositories](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `New-CCBranch`
<a name="codecommit_CreateBranch_powershell_5_topic"></a>

다음 코드 예시는 `New-CCBranch`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리의 지정된 이름과 지정된 커밋 ID로 새 브랜치를 생성합니다.**  

```
New-CCBranch -RepositoryName MyDemoRepo -BranchName MyNewBranch -CommitId 7763222d...561fc9c9
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [CreateBranch](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `New-CCRepository`
<a name="codecommit_CreateRepository_powershell_5_topic"></a>

다음 코드 예시는 `New-CCRepository`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 이름과 지정된 설명으로 새 리포지토리를 생성합니다.**  

```
New-CCRepository -RepositoryName MyDemoRepo -RepositoryDescription "This is a repository for demonstration purposes."
```
**출력:**  

```
AccountId             : 80398EXAMPLE
Arn                   : arn:aws:codecommit:us-east-1:80398EXAMPLE:MyDemoRepo
CloneUrlHttp          : https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
CloneUrlSsh           : ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
CreationDate          : 9/18/2015 4:13:25 PM
DefaultBranch         :
LastModifiedDate      : 9/18/2015 4:13:25 PM
RepositoryDescription : This is a repository for demonstration purposes.
RepositoryId          : 43ef2443-3372-4b12-9e78-65c27EXAMPLE
RepositoryName        : MyDemoRepo
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [CreateRepository](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Remove-CCRepository`
<a name="codecommit_DeleteRepository_powershell_5_topic"></a>

다음 코드 예시는 `Remove-CCRepository`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리를 강제로 삭제합니다. 명령을 실행하면 계속 진행하기 전에 확인하라는 프롬프트가 표시됩니다. -Force 파라미터를 추가하여 프롬프트 없이 리포지토리를 삭제합니다.**  

```
Remove-CCRepository -RepositoryName MyDemoRepo
```
**출력:**  

```
43ef2443-3372-4b12-9e78-65c27EXAMPLE
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteRepository](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Update-CCDefaultBranch`
<a name="codecommit_UpdateDefaultBranch_powershell_5_topic"></a>

다음 코드 예시는 `Update-CCDefaultBranch`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리의 기본 브랜치를 지정된 브랜치로 변경합니다.**  

```
Update-CCDefaultBranch -RepositoryName MyDemoRepo -DefaultBranchName MyNewBranch
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [UpdateDefaultBranch](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Update-CCRepositoryDescription`
<a name="codecommit_UpdateRepositoryDescription_powershell_5_topic"></a>

다음 코드 예시는 `Update-CCRepositoryDescription`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리에 대한 설명을 변경합니다.**  

```
Update-CCRepositoryDescription -RepositoryName MyDemoRepo -RepositoryDescription "This is an updated description."
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [UpdateRepositoryDescription](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Update-CCRepositoryName`
<a name="codecommit_UpdateRepositoryName_powershell_5_topic"></a>

다음 코드 예시는 `Update-CCRepositoryName`의 사용 방법을 보여줍니다.

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 지정된 리포지토리의 이름을 변경합니다.**  

```
Update-CCRepositoryName -NewName MyDemoRepo2 -OldName MyDemoRepo
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [UpdateRepositoryName](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.