

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

# Utilizzo di `DescribeEffectivePatchesForPatchBaseline` con una CLI
<a name="example_ssm_DescribeEffectivePatchesForPatchBaseline_section"></a>

I seguenti esempi di codice mostrano come usare `DescribeEffectivePatchesForPatchBaseline`.

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

**AWS CLI**  
**Esempio 1: ottenimento di tutte le patch definite da una baseline delle patch**  
Quanto segue `describe-effective-patches-for-patch-baseline` L'esempio restituisce le patch definite da una baseline di patch personalizzata nella versione corrente AWS account. Si noti che per una baseline personalizzata, è richiesto solo l’ID per `--baseline-id`.  

```
aws ssm describe-effective-patches-for-patch-baseline \
    --baseline-id {{"pb-08b654cf9b9681f04"}}
```
Output:  

```
{
    "EffectivePatches": [
        {
            "Patch": {
                "Id": "fe6bd8c2-3752-4c8b-ab3e-1a7ed08767ba",
                "ReleaseDate": 1544047205.0,
                "Title": "2018-11 Update for Windows Server 2019 for x64-based Systems (KB4470788)",
                "Description": "Install this update to resolve issues in Windows. For a complete listing of the issues that are included in this update, see the associated Microsoft Knowledge Base article for more information. After you install this item, you may have to restart your computer.",
                "ContentUrl": "https://support.microsoft.com/en-us/kb/4470788",
                "Vendor": "Microsoft",
                "ProductFamily": "Windows",
                "Product": "WindowsServer2019",
                "Classification": "SecurityUpdates",
                "MsrcSeverity": "Critical",
                "KbNumber": "KB4470788",
                "MsrcNumber": "",
                "Language": "All"
            },
            "PatchStatus": {
                "DeploymentStatus": "APPROVED",
                "ComplianceLevel": "CRITICAL",
                "ApprovalDate": 1544047205.0
            }
        },
        {
            "Patch": {
                "Id": "915a6b1a-f556-4d83-8f50-b2e75a9a7e58",
                "ReleaseDate": 1549994400.0,
                "Title": "2019-02 Cumulative Update for .NET Framework 3.5 and 4.7.2 for Windows Server 2019 for x64 (KB4483452)",
                "Description": "A security issue has been identified in a Microsoft software product that could affect your system. You can help protect your system by installing this update from Microsoft. For a complete listing of the issues that are included in this update, see the associated Microsoft Knowledge Base article. After you install this update, you may have to restart your system.",
                "ContentUrl": "https://support.microsoft.com/en-us/kb/4483452",
                "Vendor": "Microsoft",
                "ProductFamily": "Windows",
                "Product": "WindowsServer2019",
                "Classification": "SecurityUpdates",
                "MsrcSeverity": "Important",
                "KbNumber": "KB4483452",
                "MsrcNumber": "",
                "Language": "All"
            },
            "PatchStatus": {
                "DeploymentStatus": "APPROVED",
                "ComplianceLevel": "CRITICAL",
                "ApprovalDate": 1549994400.0
            }
        }
    ],
    "NextToken": "--token string truncated--"
}
```
**Esempio 2: per ottenere tutte le patch definite da un AWS linea di base delle patch gestite**  
Quanto segue `describe-effective-patches-for-patch-baseline` l'esempio restituisce le patch definite da un AWS linea di base delle patch gestite. Nota che per un AWS linea di base gestita, è richiesto l'ARN di riferimento completo per `--baseline-id`.  

```
aws ssm describe-effective-patches-for-patch-baseline \
    --baseline-id {{"arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-020d361a05defe4ed"}}
```
Output:  

```
{
    "EffectivePatches": [
        {
            "Patch": {
                "Id": "fe6bd8c2-3752-4c8b-ab3e-1a7ed08767ba",
                "ReleaseDate": 1544047205.0,
                "Title": "2018-11 Update for Windows Server 2019 for x64-based Systems (KB4470788)",
                "Description": "Install this update to resolve issues in Windows. For a complete listing of the issues that are included in this update, see the associated Microsoft Knowledge Base article for more information. After you install this item, you may have to restart your computer.",
                "ContentUrl": "https://support.microsoft.com/en-us/kb/4470788",
                "Vendor": "Microsoft",
                "ProductFamily": "Windows",
                "Product": "WindowsServer2019",
                "Classification": "SecurityUpdates",
                "MsrcSeverity": "Critical",
                "KbNumber": "KB4470788",
                "MsrcNumber": "",
                "Language": "All"
            },
            "PatchStatus": {
                "DeploymentStatus": "APPROVED",
                "ComplianceLevel": "UNSPECIFIED",
                "ApprovalDate": 1544652005.0
            }
        }
    ],
    "NextToken": "--token string truncated--"
}
```
Per ulteriori informazioni, consulta [Come vengono selezionate le patch di sicurezza](https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-how-it-works-selection.html) nella *Guida per l’utente di AWS Systems Manager*.  
+  Per i dettagli sull'API, consulta [DescribeEffectivePatchesForPatchBaseline](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ssm/describe-effective-patches-for-patch-baseline.html) nel *AWS CLI Riferimento al comando*. 

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

**Strumenti per PowerShell V4**  
**Esempio 1: questo esempio elenca tutte le baseline delle patch, con un elenco di risultati massimo di 1.**  

```
Get-SSMEffectivePatchesForPatchBaseline -BaselineId "pb-0a2f1059b670ebd31" -MaxResult 1
```
**Output:**  

```
Patch                                      PatchStatus
-----                                      -----------
Amazon.SimpleSystemsManagement.Model.Patch Amazon.SimpleSystemsManagement.Model.PatchStatus
```
**Esempio 2: questo esempio visualizza lo stato delle patch per tutte baseline delle patch, con un elenco di risultati massimo di 1.**  

```
(Get-SSMEffectivePatchesForPatchBaseline -BaselineId "pb-0a2f1059b670ebd31" -MaxResult 1).PatchStatus
```
**Output:**  

```
ApprovalDate          DeploymentStatus
------------          ----------------
12/21/2010 6:00:00 PM APPROVED
```
+  Per i dettagli sull'API, vedi [DescribeEffectivePatchesForPatchBaseline](https://docs.aws.amazon.com/powershell/v4/reference) nel *AWS Strumenti per PowerShell Riferimento al cmdlet (V4)*. 

**Strumenti per PowerShell V5**  
**Esempio 1: questo esempio elenca tutte le baseline delle patch, con un elenco di risultati massimo di 1.**  

```
Get-SSMEffectivePatchesForPatchBaseline -BaselineId "pb-0a2f1059b670ebd31" -MaxResult 1
```
**Output:**  

```
Patch                                      PatchStatus
-----                                      -----------
Amazon.SimpleSystemsManagement.Model.Patch Amazon.SimpleSystemsManagement.Model.PatchStatus
```
**Esempio 2: questo esempio visualizza lo stato delle patch per tutte baseline delle patch, con un elenco di risultati massimo di 1.**  

```
(Get-SSMEffectivePatchesForPatchBaseline -BaselineId "pb-0a2f1059b670ebd31" -MaxResult 1).PatchStatus
```
**Output:**  

```
ApprovalDate          DeploymentStatus
------------          ----------------
12/21/2010 6:00:00 PM APPROVED
```
+  Per i dettagli sull'API, vedi [DescribeEffectivePatchesForPatchBaseline](https://docs.aws.amazon.com/powershell/v5/reference) nel *AWS Strumenti per PowerShell Riferimento al cmdlet (V5)*. 

------

Per un elenco completo di AWS Guide per sviluppatori SDK ed esempi di codice, consulta [L'utilizzo di questo servizio con un AWS SDK](sdk-general-information-section.md). Questo argomento include anche informazioni su come iniziare e dettagli sulle versioni precedenti dell’SDK.