

Sono disponibili altri esempi AWS SDK nel repository [AWS Doc SDK](https://github.com/awsdocs/aws-doc-sdk-examples) Examples. GitHub 

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

# CodeCommit esempi di utilizzo di Tools for V4 PowerShell
<a name="powershell_4_codecommit_code_examples"></a>

I seguenti esempi di codice mostrano come eseguire azioni e implementare scenari comuni utilizzando AWS Strumenti per PowerShell V4 con. CodeCommit

Le *azioni* sono estratti di codice da programmi più grandi e devono essere eseguite nel contesto. Sebbene le azioni mostrino come richiamare le singole funzioni del servizio, è possibile visualizzarle contestualizzate negli scenari correlati.

Ogni esempio include un link al codice sorgente completo, in cui vengono fornite le istruzioni su come configurare ed eseguire il codice nel contesto.

**Topics**
+ [Azioni](#actions)

## Azioni
<a name="actions"></a>

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

Il seguente esempio di codice mostra come utilizzare`Get-CCBranch`.

**Strumenti per PowerShell V4**  
**Esempio 1: questo esempio ottiene informazioni sulla ramificazione specificata per il repository specificato.**  

```
Get-CCBranch -RepositoryName MyDemoRepo -BranchName MyNewBranch
```
**Output:**  

```
BranchName                              CommitId
----------                              --------
MyNewBranch                             7763222d...561fc9c9
```
+  Per i dettagli sull'API, vedere [GetBranch](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 

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

Il seguente esempio di codice mostra come utilizzare. `Get-CCBranchList`

**Strumenti per PowerShell V4**  
**Esempio 1: questo esempio ottiene un elenco di nomi di ramificazione per il repository specificato.**  

```
Get-CCBranchList -RepositoryName MyDemoRepo
```
**Output:**  

```
master
MyNewBranch
```
+  Per i dettagli sull'API, vedere [ListBranches](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 

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

Il seguente esempio di codice mostra come utilizzare. `Get-CCRepository`

**Strumenti per PowerShell V4**  
**Esempio 1: questo esempio ottiene informazioni sul repository specificato.**  

```
Get-CCRepository -RepositoryName MyDemoRepo
```
**Output:**  

```
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
```
+  Per i dettagli sull'API, vedere [GetRepository](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 

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

Il seguente esempio di codice mostra come utilizzare. `Get-CCRepositoryBatch`

**Strumenti per PowerShell V4**  
**Esempio 1: questo esempio conferma quali dei repository specificati sono stati trovati o meno.**  

```
Get-CCRepositoryBatch -RepositoryName MyDemoRepo, MyNewRepo, AMissingRepo
```
**Output:**  

```
Repositories                            RepositoriesNotFound
------------                            --------------------
{MyDemoRepo, MyNewRepo}                {AMissingRepo}
```
+  Per i dettagli sull'API, vedere [BatchGetRepositories](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 

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

Il seguente esempio di codice mostra come utilizzare. `Get-CCRepositoryList`

**Strumenti per PowerShell V4**  
**Esempio 1: questo esempio elenca tutti i repository in ordine crescente per nome di repository.**  

```
Get-CCRepositoryList -Order Ascending -SortBy RepositoryName
```
**Output:**  

```
RepositoryId                            RepositoryName
------------                            --------------
c7d0d2b0-ce40-4303-b4c3-38529EXAMPLE    MyDemoRepo
05f30c66-e3e3-4f91-a0cd-1c84aEXAMPLE    MyNewRepo
```
+  Per i dettagli sull'API, vedere [ListRepositories](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 

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

Il seguente esempio di codice mostra come utilizzare. `New-CCBranch`

**Strumenti per PowerShell V4**  
**Esempio 1: questo esempio crea una nuova ramificazione con il nome specificato per il repository e l’ID commit specificati.**  

```
New-CCBranch -RepositoryName MyDemoRepo -BranchName MyNewBranch -CommitId 7763222d...561fc9c9
```
+  Per i dettagli sull'API, vedere [CreateBranch](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 

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

Il seguente esempio di codice mostra come utilizzare. `New-CCRepository`

**Strumenti per PowerShell V4**  
**Esempio 1: questo esempio crea un nuovo repository con il nome e la descrizione specificati.**  

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

```
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
```
+  Per i dettagli sull'API, vedere [CreateRepository](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 

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

Il seguente esempio di codice mostra come utilizzare. `Remove-CCRepository`

**Strumenti per PowerShell V4**  
**Esempio 1: questo esempio forza l’eliminazione del repository specificato. Il comando richiederà una conferma prima di procedere. Aggiungi il parametro -Force per eliminare il repository senza una richiesta di conferma.**  

```
Remove-CCRepository -RepositoryName MyDemoRepo
```
**Output:**  

```
43ef2443-3372-4b12-9e78-65c27EXAMPLE
```
+  Per i dettagli sull'API, vedere [DeleteRepository](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 

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

Il seguente esempio di codice mostra come utilizzare. `Update-CCDefaultBranch`

**Strumenti per PowerShell V4**  
**Esempio 1: questo esempio modifica la ramificazione predefinita per il repository specificato nella ramificazione specificata.**  

```
Update-CCDefaultBranch -RepositoryName MyDemoRepo -DefaultBranchName MyNewBranch
```
+  Per i dettagli sull'API, vedere [UpdateDefaultBranch](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 

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

Il seguente esempio di codice mostra come utilizzare. `Update-CCRepositoryDescription`

**Strumenti per PowerShell V4**  
**Esempio 1: questo esempio modifica la descrizione del repository specificato.**  

```
Update-CCRepositoryDescription -RepositoryName MyDemoRepo -RepositoryDescription "This is an updated description."
```
+  Per i dettagli sull'API, vedere [UpdateRepositoryDescription](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 

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

Il seguente esempio di codice mostra come utilizzare. `Update-CCRepositoryName`

**Strumenti per PowerShell V4**  
**Esempio 1: questo esempio modifica il nome del repository specificato.**  

```
Update-CCRepositoryName -NewName MyDemoRepo2 -OldName MyDemoRepo
```
+  Per i dettagli sull'API, vedere [UpdateRepositoryName](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 