

# 将 `GetBucketInventoryConfiguration` 与 CLI 配合使用
<a name="s3_example_s3_GetBucketInventoryConfiguration_section"></a>

以下代码示例演示如何使用 `GetBucketInventoryConfiguration`。

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

**Amazon CLI**  
**检索存储桶的清单配置**  
以下 `get-bucket-inventory-configuration` 示例检索 ID 为 `1` 的指定存储桶的清单配置。  

```
aws s3api get-bucket-inventory-configuration \
    --bucket {{amzn-s3-demo-bucket}} \
    --id {{1}}
```
输出：  

```
{
    "InventoryConfiguration": {
        "IsEnabled": true,
        "Destination": {
            "S3BucketDestination": {
                "Format": "ORC",
                "Bucket": "arn:aws:s3:::amzn-s3-demo-bucket",
                "AccountId": "123456789012"
            }
        },
        "IncludedObjectVersions": "Current",
        "Id": "1",
        "Schedule": {
            "Frequency": "Weekly"
        }
    }
}
```
+  有关 API 详细信息，请参阅《Amazon CLI 命令参考》**中的 [GetBucketInventoryConfiguration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/get-bucket-inventory-configuration.html)。

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

**适用于 PowerShell V4 的工具**  
**示例 1：此命令返回给定 S3 存储桶的名为“testinventory”的清单的详细信息。**  

```
Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'
```
+  有关 API 详细信息，请参阅《Amazon Tools for PowerShell Cmdlet Reference (V4)》**中的 [GetBucketInventoryConfiguration](https://docs.amazonaws.cn/powershell/v4/reference)。

**适用于 PowerShell V5 的工具**  
**示例 1：此命令返回给定 S3 存储桶的名为“testinventory”的清单的详细信息。**  

```
Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'
```
+  有关 API 详细信息，请参阅《Amazon Tools for PowerShell Cmdlet Reference (V5)》**中的 [GetBucketInventoryConfiguration](https://docs.amazonaws.cn/powershell/v5/reference)。

------

有关 Amazon SDK 开发人员指南和代码示例的完整列表，请参阅 [使用 Amazon SDK 通过 Amazon S3 进行开发](sdk-general-information-section.md)。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。