

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à.

# Utilizzare `ListStacks` con una CLI
<a name="cloudformation_example_cloudformation_ListStacks_section"></a>

Gli esempi di codice seguenti mostrano come utilizzare `ListStacks`.

------
#### [ CLI ]

**AWS CLI**  
**Per elencare le pile AWS CloudFormation **  
Il comando `list-stacks` seguente mostra un riepilogo di tutti gli stack con stato `CREATE_COMPLETE`:  

```
aws cloudformation list-stacks --stack-status-filter CREATE_COMPLETE
```
Output:  

```
[
    {
        "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896",
        "TemplateDescription": "AWS CloudFormation Sample Template S3_Bucket: Sample template showing how to create a publicly accessible S3 bucket. **WARNING** This template creates an S3 bucket. You will be billed for the AWS resources used if you create a stack from this template.",
        "StackStatusReason": null,
        "CreationTime": "2013-08-26T03:27:10.190Z",
        "StackName": "myteststack",
        "StackStatus": "CREATE_COMPLETE"
    }
]
```
+  Per i dettagli sull'API, consulta [ListStacks AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudformation/list-stacks.html)*Command Reference.* 

------
#### [ PowerShell ]

**Strumenti per PowerShell V4**  
**Esempio 1: restituisce informazioni di riepilogo per tutti gli stack.**  

```
Get-CFNStackSummary
```
**Esempio 2: restituisce informazioni di riepilogo per tutti gli stack attualmente in fase di creazione.**  

```
Get-CFNStackSummary -StackStatusFilter "CREATE_IN_PROGRESS"
```
**Esempio 3: restituisce informazioni di riepilogo per tutti gli stack attualmente in fase di creazione o aggiornamento.**  

```
Get-CFNStackSummary -StackStatusFilter @("CREATE_IN_PROGRESS", "UPDATE_IN_PROGRESS")
```
+  Per i dettagli sull'API, vedere [ListStacks](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 

**Strumenti per V5 PowerShell **  
**Esempio 1: restituisce informazioni di riepilogo per tutti gli stack.**  

```
Get-CFNStackSummary
```
**Esempio 2: restituisce informazioni di riepilogo per tutti gli stack attualmente in fase di creazione.**  

```
Get-CFNStackSummary -StackStatusFilter "CREATE_IN_PROGRESS"
```
**Esempio 3: restituisce informazioni di riepilogo per tutti gli stack attualmente in fase di creazione o aggiornamento.**  

```
Get-CFNStackSummary -StackStatusFilter @("CREATE_IN_PROGRESS", "UPDATE_IN_PROGRESS")
```
+  Per i dettagli sull'API, vedere [ListStacks](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

------