

버전 5(V5) AWS Tools for PowerShell 가 릴리스되었습니다.

변경 사항 해제 및 애플리케이션 마이그레이션에 대한 자세한 내용은 [마이그레이션 주제를](https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html) 참조하세요.

 [https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html](https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html)

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

# Tools for PowerShell V5를 사용한 Amazon S3 예제
<a name="powershell_s3_code_examples"></a>

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

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

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

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

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

### `Copy-S3Object`
<a name="s3_CopyObject_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 “test-files” 버킷의 “sample.txt” 객체를 동일한 버킷으로 복사하지만 새로운 키인 “sample-copy.txt”를 사용합니다.**  

```
Copy-S3Object -BucketName amzn-s3-demo-bucket -Key sample.txt -DestinationKey sample-copy.txt
```
**예시 2: 이 명령은 “test-files” 버킷의 “sample.txt” 객체를 "backup-files" 버킷으로 복사하며 “sample-copy.txt” 키를 사용합니다.**  

```
Copy-S3Object -BucketName amzn-s3-demo-source-bucket -Key sample.txt -DestinationKey sample-copy.txt -DestinationBucket amzn-s3-demo-destination-bucket
```
**예시 3: 이 명령은 “test-files” 버킷에서 "local-sample.txt"라는 이름의 로컬 파일로 "sample.txt" 객체를 다운로드합니다.**  

```
Copy-S3Object -BucketName amzn-s3-demo-bucket -Key sample.txt -LocalFile local-sample.txt
```
**예시 4: 단일 객체를 지정된 파일로 다운로드합니다. 다운로드한 파일은 c:\$1downloads\$1data\$1archive.zip에서 찾을 수 있습니다.**  

```
Copy-S3Object -BucketName amzn-s3-demo-bucket -Key data/archive.zip -LocalFolder c:\downloads
```
**예시 5: 지정된 키 접두사와 일치하는 모든 객체를 로컬 폴더로 다운로드합니다. 상대 키 계층 구조는 전체 다운로드 위치에 하위 폴더로 보존됩니다.**  

```
Copy-S3Object -BucketName amzn-s3-demo-bucket -KeyPrefix data -LocalFolder c:\downloads
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [CopyObject](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-S3Bucket`
<a name="s3_ListBuckets_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 모든 S3 버킷을 반환합니다.**  

```
Get-S3Bucket
```
**예시 2: 이 명령은 이름이 “test-files”인 버킷을 반환합니다.**  

```
Get-S3Bucket -BucketName amzn-s3-demo-bucket
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [ListBuckets](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketACL`
<a name="s3_GetBucketAcl_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 명령에서는 S3 객체의 객체 소유자 세부 정보를 가져옵니다.**  

```
(Get-S3BucketACL -BucketName 'amzn-s3-demo-bucket' -Select *).Owner
```
**출력:**  

```
DisplayName Id
----------- --
testusername      9988776a6554433d22f1100112e334acb45566778899009e9887bd7f66c5f544
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketAcl](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketAccelerateConfiguration`
<a name="s3_GetBucketAccelerateConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 버킷에 대해 전송 가속화 설정이 활성화된 경우 Enabled 값을 반환합니다.**  

```
Get-S3BucketAccelerateConfiguration -BucketName 'amzn-s3-demo-bucket'
```
**출력:**  

```
Value                                  
-----                                    
Enabled
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketAccelerateConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketAnalyticsConfiguration`
<a name="s3_GetBucketAnalyticsConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷에서 이름이 'testfilter'인 분석 필터의 세부 정보를 반환합니다.**  

```
Get-S3BucketAnalyticsConfiguration -BucketName 'amzn-s3-demo-bucket' -AnalyticsId 'testfilter'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketAnalyticsConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketAnalyticsConfigurationList`
<a name="s3_ListBucketAnalyticsConfigurations_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷의 분석 구성 중 처음 100개를 반환합니다.**  

```
Get-S3BucketAnalyticsConfigurationList -BucketName 'amzn-s3-demo-bucket'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [ListBucketAnalyticsConfigurations](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketEncryption`
<a name="s3_GetBucketEncryption_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 버킷과 연결된 모든 서버 측 암호화 규칙을 반환합니다.**  

```
Get-S3BucketEncryption -BucketName 'amzn-s3-demo-bucket'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketEncryption](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketInventoryConfiguration`
<a name="s3_GetBucketInventoryConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷에 대해 이름이 'testinventory'인 인벤토리의 세부 정보를 반환합니다.**  

```
Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketInventoryConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketInventoryConfigurationList`
<a name="s3_ListBucketInventoryConfigurations_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷의 인벤토리 구성 중 처음 100개를 반환합니다.**  

```
Get-S3BucketInventoryConfigurationList -BucketName 'amzn-s3-demo-bucket'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [ListBucketInventoryConfigurations](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketLocation`
<a name="s3_GetBucketLocation_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 명령에서는 제약 조건이 있는 경우 'amzn-s3-demo-bucket' 버킷에 대한 위치 제약 조건을 반환합니다.**  

```
Get-S3BucketLocation -BucketName 'amzn-s3-demo-bucket'
```
**출력:**  

```
Value
-----
ap-south-1
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketLocation](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketLogging`
<a name="s3_GetBucketLogging_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 버킷의 로깅 상태를 반환합니다.**  

```
Get-S3BucketLogging -BucketName 'amzn-s3-demo-bucket'
```
**출력:**  

```
TargetBucketName   Grants TargetPrefix
----------------   ------ ------------
testbucket1        {}     testprefix
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketLogging](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketMetricsConfiguration`
<a name="s3_GetBucketMetricsConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷의 'testfilter'라는 지표 필터에 대한 세부 정보를 반환합니다.**  

```
Get-S3BucketMetricsConfiguration -BucketName 'amzn-s3-demo-bucket' -MetricsId 'testfilter'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketMetricsConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketNotification`
<a name="s3_GetBucketNotification_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 예시는 지정된 버킷의 알림 구성을 검색합니다.**  

```
Get-S3BucketNotification -BucketName amzn-s3-demo-bucket | select -ExpandProperty TopicConfigurations
```
**출력:**  

```
Id   Topic
--   -----
mimo arn:aws:sns:eu-west-1:123456789012:topic-1
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketNotification](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketPolicy`
<a name="s3_GetBucketPolicy_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷과 연결된 버킷 정책을 출력합니다.**  

```
Get-S3BucketPolicy -BucketName 'amzn-s3-demo-bucket'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketPolicy](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-S3BucketPolicyStatus`
<a name="s3_GetBucketPolicyStatus_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 버킷이 퍼블릭 버킷인지 여부를 나타내는 지정된 S3 버킷에 대한 정책 상태를 반환합니다.**  

```
Get-S3BucketPolicyStatus -BucketName 'amzn-s3-demo-bucket'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketPolicyStatus](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-S3BucketReplication`
<a name="s3_GetBucketReplication_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이름이 'amzn-s3-demo-bucket'인 버킷에 설정된 복제 구성 정보를 반환합니다.**  

```
Get-S3BucketReplication -BucketName amzn-s3-demo-bucket
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketReplication](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketRequestPayment`
<a name="s3_GetBucketRequestPayment_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이름이 'amzn-s3-demo-bucket'인 버킷에 대한 요청 결제 구성을 반환합니다. 기본적으로 버킷에서 다운로드하는 비용은 버킷 소유자가 지불합니다.**  

```
Get-S3BucketRequestPayment -BucketName amzn-s3-demo-bucket
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketRequestPayment](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-S3BucketTagging`
<a name="s3_GetBucketTagging_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 버킷과 관련된 모든 태그를 반환합니다.**  

```
Get-S3BucketTagging -BucketName 'amzn-s3-demo-bucket'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketTagging](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketVersioning`
<a name="s3_GetBucketVersioning_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 버킷과 관련된 버전 관리 상태를 반환합니다.**  

```
Get-S3BucketVersioning -BucketName 'amzn-s3-demo-bucket'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketVersioning](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3BucketWebsite`
<a name="s3_GetBucketWebsite_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷의 정적 웹 사이트 구성 세부 정보를 반환합니다.**  

```
Get-S3BucketWebsite -BucketName 'amzn-s3-demo-bucket'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetBucketWebsite](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-S3CORSConfiguration`
<a name="s3_GetCORSConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 명령에서는 지정된 S3 버킷에 해당하는 모든 CORS 구성 규칙을 포함하는 객체를 반환합니다.**  

```
Get-S3CORSConfiguration -BucketName 'amzn-s3-demo-bucket' -Select Configuration.Rules
```
**출력:**  

```
AllowedMethods : {PUT, POST, DELETE}
AllowedOrigins : {http://www.example1.com}
Id             : 
ExposeHeaders  : {}
MaxAgeSeconds  : 0
AllowedHeaders : {*}

AllowedMethods : {PUT, POST, DELETE}
AllowedOrigins : {http://www.example2.com}
Id             : 
ExposeHeaders  : {}
MaxAgeSeconds  : 0
AllowedHeaders : {*}

AllowedMethods : {GET}
AllowedOrigins : {*}
Id             : 
ExposeHeaders  : {}
MaxAgeSeconds  : 0
AllowedHeaders : {}
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetCORSConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3HeadBucket`
<a name="s3_HeadBucket_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 명령에서는 사용자에게 액세스 권한이 있을 때 기존 버킷에 대해 HTTP 상태 코드 200 OK로 출력을 반환합니다. BucketArn 파라미터는 S3 디렉터리 버킷에서만 지원됩니다.**  

```
Get-S3HeadBucket -BucketName amzn-s3-demo-bucket
```
**출력:**  

```
AccessPointAlias   : False
BucketArn          :
BucketLocationName : 
BucketLocationType : 
BucketRegion       : us-east-2
ResponseMetadata   : Amazon.Runtime.ResponseMetadata
ContentLength      : 0
HttpStatusCode     : OK
```
**예제 2: 이 명령에서는 존재하지 않는 버킷에 대해 HTTP 상태 코드 NotFound와 함께 오류가 발생합니다.**  

```
Get-S3HeadBucket -BucketName amzn-s3-non-existing-bucket
```
**출력:**  

```
Get-S3HeadBucket: Error making request with Error Code NotFound and Http Status Code NotFound. No further error information was returned by the service.
```
**예제 3: 이 명령에서는 사용자에게 액세스 권한이 없는 기존 버킷에 대해 HTTP 상태 코드 Forbidden 오류가 발생합니다.**  

```
Get-S3HeadBucket -BucketName amzn-s3-no-access-bucket
```
**출력:**  

```
Get-S3HeadBucket: Error making request with Error Code Forbidden and Http Status Code Forbidden. No further error information was returned by the service.
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [HeadBucket](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3LifecycleConfiguration`
<a name="s3_GetLifecycleConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 버킷의 수명 주기 구성을 검색합니다.**  

```
Get-S3LifecycleConfiguration -BucketName amzn-s3-demo-bucket
```
**출력:**  

```
Rules
-----
{Remove-in-150-days, Archive-to-Glacier-in-30-days}
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetLifecycleConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3Object`
<a name="s3_ListObjects_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 “test-files” 버킷에 있는 모든 항목에 대한 정보를 검색합니다.**  

```
Get-S3Object -BucketName amzn-s3-demo-bucket
```
**예시 2: 이 명령은 "test-files" 버킷에서 "sample.txt" 항목에 대한 정보를 검색합니다.**  

```
Get-S3Object -BucketName amzn-s3-demo-bucket -Key sample.txt
```
**예시 3: 이 명령은 “test-files” 버킷에서 접두사가 “sample”인 모든 항목에 대한 정보를 검색합니다.**  

```
Get-S3Object -BucketName amzn-s3-demo-bucket -KeyPrefix sample
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet Reference (V5)*의 [ListObjects](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-S3ObjectACL`
<a name="s3_GetObjectAcl_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 명령에서는 S3 객체의 객체 소유자 세부 정보를 가져옵니다.**  

```
(Get-S3ObjectACL -BucketName 'amzn-s3-demo-bucket' -key 'initialize.ps1' -Select *).Owner
```
**출력:**  

```
DisplayName Id
----------- --
testusername      9988776a6554433d22f1100112e334acb45566778899009e9887bd7f66c5f544
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetObjectAcl](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3ObjectLockConfiguration`
<a name="s3_GetObjectLockConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷에 대해 객체 잠금 구성이 활성화된 경우 'Enabled' 값을 반환합니다.**  

```
Get-S3ObjectLockConfiguration -BucketName 'amzn-s3-demo-bucket' -Select ObjectLockConfiguration.ObjectLockEnabled
```
**출력:**  

```
Value
-----
Enabled
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetObjectLockConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3ObjectMetadata`
<a name="s3_GetObjectMetadata_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 명령에서는 지정된 S3 버킷에 'ListTrusts.txt' 키가 있는 객체의 메타데이터를 반환합니다.**  

```
Get-S3ObjectMetadata -BucketName 'amzn-s3-demo-bucket' -Key 'ListTrusts.txt'
```
**출력:**  

```
Headers                                       : Amazon.S3.Model.HeadersCollection
Metadata                                      : Amazon.S3.Model.MetadataCollection
DeleteMarker                                  : 
AcceptRanges                                  : bytes
ContentRange                                  : 
Expiration                                    : 
RestoreExpiration                             : 
RestoreInProgress                             : False
LastModified                                  : 01/01/2020 08:02:05
ETag                                          : "d000011112a222e333e3bb4ee5d43d21"
MissingMeta                                   : 0
VersionId                                     : null
Expires                                       : 01/01/0001 00:00:00
WebsiteRedirectLocation                       : 
ServerSideEncryptionMethod                    : AES256
ServerSideEncryptionCustomerMethod            : 
ServerSideEncryptionKeyManagementServiceKeyId : 
ReplicationStatus                             : 
PartsCount                                    : 
ObjectLockLegalHoldStatus                     : 
ObjectLockMode                                : 
ObjectLockRetainUntilDate                     : 01/01/0001 00:00:00
StorageClass                                  : 
RequestCharged                                :
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetObjectMetadata](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Get-S3ObjectRetention`
<a name="s3_GetObjectRetention_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 객체 보존의 모드와 종료 날짜를 반환합니다.**  

```
Get-S3ObjectRetention -BucketName 'amzn-s3-demo-bucket' -Key 'testfile.txt'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetObjectRetention](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3ObjectTagSet`
<a name="s3_GetObjectTagging_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 샘플은 지정된 S3 버킷에 있는 객체와 연결된 태그를 반환합니다.**  

```
Get-S3ObjectTagSet -Key 'testfile.txt' -BucketName 'amzn-s3-demo-bucket'
```
**출력:**  

```
Key  Value
---  -----
test value
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetObjectTagging](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3PreSignedURL`
<a name="s3_GetPreSignedURL_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 명령에서는 지정된 키와 만료 날짜에 대해 미리 서명된 URL을 반환합니다.**  

```
Get-S3PreSignedURL -BucketName 'amzn-s3-demo-bucket' -Key 'testkey' -Expires '2023-11-16'
```
**예제 2: 이 명령에서는 지정된 키와 만료 날짜가 있는 디렉터리 버킷에 대해 미리 서명된 URL을 반환합니다.**  

```
[Amazon.AWSConfigsS3]::UseSignatureVersion4 = $true
      Get-S3PreSignedURL -BucketName amzn-s3-demo-bucket--usw2-az1--x-s3 -Key 'testkey' -Expire '2023-11-17'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetPreSignedURL](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3PublicAccessBlock`
<a name="s3_GetPublicAccessBlock_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷의 퍼블릭 액세스 차단 구성을 반환합니다.**  

```
Get-S3PublicAccessBlock -BucketName 'amzn-s3-demo-bucket'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetPublicAccessBlock](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Get-S3Version`
<a name="s3_ListVersions_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 명령에서는 지정된 S3 버킷의 모든 객체 버전에 대한 메타데이터를 반환합니다.**  

```
Get-S3Version -BucketName 'amzn-s3-demo-bucket'
```
**출력:**  

```
IsTruncated         : False
KeyMarker           : 
VersionIdMarker     : 
NextKeyMarker       : 
NextVersionIdMarker : 
Versions            : {EC2.txt, EC2MicrosoftWindowsGuide.txt, ListDirectories.json, ListTrusts.json}
Name                : amzn-s3-demo-bucket
Prefix              : 
MaxKeys             : 1000
CommonPrefixes      : {}
Delimiter           :
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [ListVersions](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `New-S3Bucket`
<a name="s3_PutBucket_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 명령에서는 'sample-bucket'이라는 새 프라이빗 버킷을 생성합니다.**  

```
New-S3Bucket -BucketName amzn-s3-demo-bucket
```
**예제 2: 이 명령에서는 읽기-쓰기 권한을 가진 'sample-bucket'이라는 새 버킷을 생성합니다.**  

```
New-S3Bucket -BucketName amzn-s3-demo-bucket -PublicReadWrite
```
**예제 3: 이 명령에서는 읽기 전용 권한을 가진 'sample-bucket'이라는 새 버킷을 생성합니다.**  

```
New-S3Bucket -BucketName amzn-s3-demo-bucket -PublicReadOnly
```
**예제 4: 이 명령에서는 PutBucketConfiguration을 사용하여 'amzn-s3-demo-bucket--use1-az5--x-s3'이라는 새 디렉터리 버킷을 생성합니다.**  

```
$bucketConfiguration = @{
      BucketInfo = @{
          DataRedundancy = 'SingleAvailabilityZone'
          Type = 'Directory'
      }
      Location = @{
          Name = 'usw2-az1'
          Type = 'AvailabilityZone'
      }
    }
New-S3Bucket -BucketName amzn-s3-demo-bucket--usw2-az1--x-s3 -BucketConfiguration $bucketConfiguration -Region us-west-2
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutBucket](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Read-S3Object`
<a name="s3_GetObject_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1:이 명령은 버킷 "amzn-s3-demo-bucket"에서 "sample.txt" 항목을 검색하여 현재 위치의 "local-sample.txt"라는 파일에 저장합니다. 이 명령을 직접 호출하기 전에 "local-sample.txt" 파일이 없어도 됩니다.**  

```
Read-S3Object -BucketName amzn-s3-demo-bucket -Key sample.txt -File local-sample.txt
```
**예제 2:이 명령은 버킷 "amzn-s3-demo-bucket"에서 가상 디렉터리 "DIR"을 검색하여 현재 위치의 "Local-DIR" 폴더에 저장합니다. 이 명령을 직접 호출하기 전에 "Local-DIR" 폴더가 없어도 됩니다.**  

```
Read-S3Object -BucketName amzn-s3-demo-bucket -KeyPrefix DIR -Folder Local-DIR
```
**예시 3: 버킷 이름에 'config'가 있는 버킷에서 키가 '.json'으로 끝나는 모든 객체를 지정된 폴더의 파일로 다운로드합니다. 객체 키는 파일 이름을 설정하는 데 사용됩니다.**  

```
Get-S3Bucket | ? { $_.BucketName -like '*config*' } | Get-S3Object | ? { $_.Key -like '*.json' } | Read-S3Object -Folder C:\ConfigObjects
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetObject](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Remove-S3Bucket`
<a name="s3_DeleteBucket_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 'test-files' 버킷에서 모든 객체 및 객체 버전을 제거한 다음 버킷을 삭제합니다. 명령을 실행하면 계속 진행하기 전에 확인하라는 프롬프트가 표시됩니다. 확인 프롬프트를 차단하려면 -Force 스위치를 추가합니다. 비어 있지 않은 버킷은 삭제할 수 없다는 점에 유의하세요.**  

```
Remove-S3Bucket -BucketName amzn-s3-demo-bucket -DeleteBucketContent
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteBucket](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Remove-S3BucketAnalyticsConfiguration`
<a name="s3_DeleteBucketAnalyticsConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷에서 이름이 'testfilter'인 분석 필터를 제거합니다.**  

```
Remove-S3BucketAnalyticsConfiguration -BucketName 'amzn-s3-demo-bucket' -AnalyticsId 'testfilter'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteBucketAnalyticsConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Remove-S3BucketEncryption`
<a name="s3_DeleteBucketEncryption_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이렇게 하면 제공된 S3 버킷에 대해 활성화된 암호화가 비활성화됩니다.**  

```
Remove-S3BucketEncryption -BucketName 'amzn-s3-demo-bucket'
```
**출력:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-S3BucketEncryption (DeleteBucketEncryption)" on target "s3casetestbucket".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteBucketEncryption](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Remove-S3BucketInventoryConfiguration`
<a name="s3_DeleteBucketInventoryConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷에 해당하는 'testInventoryName'이라는 이름의 인벤토리를 제거합니다.**  

```
Remove-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testInventoryName'
```
**출력:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-S3BucketInventoryConfiguration (DeleteBucketInventoryConfiguration)" on target "amzn-s3-demo-bucket".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteBucketInventoryConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Remove-S3BucketMetricsConfiguration`
<a name="s3_DeleteBucketMetricsConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷에서 이름이 'testmetrics'인 지표 필터를 제거합니다.**  

```
Remove-S3BucketMetricsConfiguration -BucketName 'amzn-s3-demo-bucket' -MetricsId 'testmetrics'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteBucketMetricsConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Remove-S3BucketPolicy`
<a name="s3_DeleteBucketPolicy_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷과 연결된 버킷 정책을 제거합니다.**  

```
Remove-S3BucketPolicy -BucketName 'amzn-s3-demo-bucket'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteBucketPolicy](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Remove-S3BucketReplication`
<a name="s3_DeleteBucketReplication_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이름이 'amzn-s3-demo-bucket'인 버킷과 연결된 복제 구성을 삭제합니다. 이 작업에는 s3:DeleteReplicationConfiguration 작업에 대한 권한이 필요합니다. 작업이 진행되기 전에 확인 메시지가 표시됩니다. 확인 메시지를 차단하려면 -Force 스위치를 사용하세요.**  

```
Remove-S3BucketReplication -BucketName amzn-s3-demo-bucket
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteBucketReplication](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Remove-S3BucketTagging`
<a name="s3_DeleteBucketTagging_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷과 연결된 모든 태그를 제거합니다.**  

```
Remove-S3BucketTagging -BucketName 'amzn-s3-demo-bucket'
```
**출력:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-S3BucketTagging (DeleteBucketTagging)" on target "amzn-s3-demo-bucket".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteBucketTagging](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Remove-S3BucketWebsite`
<a name="s3_DeleteBucketWebsite_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷의 정적 웹 사이트 호스팅 속성을 비활성화합니다.**  

```
Remove-S3BucketWebsite -BucketName 'amzn-s3-demo-bucket'
```
**출력:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-S3BucketWebsite (DeleteBucketWebsite)" on target "amzn-s3-demo-bucket".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteBucketWebsite](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Remove-S3CORSConfiguration`
<a name="s3_DeleteCORSConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 명령에서는 지정된 S3 버킷의 CORS 구성을 제거합니다.**  

```
Remove-S3CORSConfiguration -BucketName 'amzn-s3-demo-bucket'
```
**출력:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-S3CORSConfiguration (DeleteCORSConfiguration)" on target "amzn-s3-demo-bucket".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteCORSConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Remove-S3LifecycleConfiguration`
<a name="s3_DeleteLifecycleConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 명령에서는 지정된 S3 버킷에 대한 모든 수명 주기 규칙을 제거합니다.**  

```
Remove-S3LifecycleConfiguration -BucketName 'amzn-s3-demo-bucket'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteLifecycleConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Remove-S3MultipartUpload`
<a name="s3_AbortMultipartUpload_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 5일 이전에 생성된 멀티파트 업로드를 중단합니다.**  

```
Remove-S3MultipartUpload -BucketName amzn-s3-demo-bucket -DaysBefore 5
```
**예시 2: 이 명령은 2014년 1월 2일 이전에 생성된 멀티파트 업로드를 중단합니다.**  

```
Remove-S3MultipartUpload -BucketName amzn-s3-demo-bucket -InitiatedDate "Thursday, January 02, 2014"
```
**예시 3: 이 명령은 2014년 1월 2일 10시 45분 37초 이전에 생성된 멀티파트 업로드를 중단합니다.**  

```
Remove-S3MultipartUpload -BucketName amzn-s3-demo-bucket -InitiatedDate "2014/01/02 10:45:37"
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [AbortMultipartUpload](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Remove-S3Object`
<a name="s3_DeleteObjects_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 "test-files" 버킷에서 "sample.txt" 객체를 제거합니다. 명령이 실행되기 전에 확인 프롬프트가 표시됩니다. 확인 프롬프트를 차단하려면 -Force 스위치를 사용하세요.**  

```
Remove-S3Object -BucketName amzn-s3-demo-bucket -Key sample.txt
```
**예시 2: 이 명령은 버킷이 객체 버전을 활성화하도록 구성된 경우 “test-files” 버킷에서 지정된 버전의 “sample.txt” 객체를 제거합니다.**  

```
Remove-S3Object -BucketName amzn-s3-demo-bucket -Key sample.txt -VersionId HLbxnx6V9omT6AQYVpks8mmFKQcejpqt
```
**예시 3: 이 명령은 단일 배치 작업으로 "test-files" 버킷에서 "sample1.txt", "sample2.txt" 및 "sample3.txt" 객체를 제거합니다. 서비스 응답에는 삭제의 성공 또는 오류 상태에 관계없이 처리된 모든 키가 나열됩니다. 서비스에서 처리하지 못한 키에 대한 오류만 가져오려면 -ReportErrorsOnly 파라미터를 추가합니다. 이 파라미터는 -Quiet라는 별칭으로 지정할 수도 있습니다.**  

```
Remove-S3Object -BucketName amzn-s3-demo-bucket -KeyCollection @( "sample1.txt", "sample2.txt", "sample3.txt" )
```
**예시 4: 이 예시는 -keyCollection 파라미터와 함께 인라인 표현식을 사용하여 삭제할 객체의 키를 가져옵니다. Get-S3Object는 Amazon.S3.Model.S3Object 인스턴스의 컬렉션을 반환하며, 각 인스턴스에는 객체를 식별하는 유형 문자열의 키 멤버가 있습니다.**  

```
Remove-S3Object -bucketname "amzn-s3-demo-bucket" -KeyCollection (Get-S3Object "test-files" -KeyPrefix "prefix/subprefix" | select -ExpandProperty Key)
```
**예시 5: 이 예시는 버킷에서 키 접두사 “prefix/subprefix”가 있는 모든 객체를 가져와 삭제합니다. 들어오는 객체는 한 번에 하나씩 처리됩니다. 대규모 컬렉션의 경우, 컬렉션을 cmdlet의 -InputObject(별칭 -S3ObjectCollection) 파라미터에 전달하여 서비스를 한 번 직접적으로 호출함으로써 일괄 삭제가 이루어지도록 하는 것이 좋습니다.**  

```
Get-S3Object -BucketName "amzn-s3-demo-bucket" -KeyPrefix "prefix/subprefix" | Remove-S3Object -Force
```
**예시 6: 이 예시는 삭제 마커를 나타내는 Amazon.S3.Model.S3ObjectVersion 인스턴스 컬렉션을 cmdlet으로 파이프하여 삭제합니다. 들어오는 객체는 한 번에 하나씩 처리됩니다. 대규모 컬렉션의 경우, 컬렉션을 cmdlet의 -InputObject(별칭 -S3ObjectCollection) 파라미터에 전달하여 서비스를 한 번 직접적으로 호출함으로써 일괄 삭제가 이루어지도록 하는 것이 좋습니다.**  

```
(Get-S3Version -BucketName "amzn-s3-demo-bucket").Versions | Where {$_.IsDeleteMarker -eq "True"} | Remove-S3Object -Force
```
**예시 7: 이 스크립트는 -KeyAndVersionCollection 파라미터와 함께 사용할 객체의 배열을 구성하여 객체 집합(이 경우에는 삭제 마커)을 일괄 삭제하는 방법을 보여 줍니다.**  

```
$keyVersions = @()
$markers = (Get-S3Version -BucketName $BucketName).Versions | Where {$_.IsDeleteMarker -eq "True"}
foreach ($marker in $markers) { $keyVersions += @{ Key = $marker.Key; VersionId = $marker.VersionId } }
Remove-S3Object -BucketName $BucketName -KeyAndVersionCollection $keyVersions -Force
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteObjects](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Remove-S3ObjectTagSet`
<a name="s3_DeleteObjectTagging_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷에서 'testfile.txt' 키가 있는 객체와 연결된 모든 태그를 제거합니다.**  

```
Remove-S3ObjectTagSet -Key 'testfile.txt' -BucketName 'amzn-s3-demo-bucket' -Select '^Key'
```
**출력:**  

```
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-S3ObjectTagSet (DeleteObjectTagging)" on target "testfile.txt".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
testfile.txt
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeleteObjectTagging](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Remove-S3PublicAccessBlock`
<a name="s3_DeletePublicAccessBlock_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 버킷의 퍼블릭 액세스 차단 설정을 끕니다.**  

```
Remove-S3PublicAccessBlock -BucketName 'amzn-s3-demo-bucket' -Force -Select '^BucketName'
```
**출력:**  

```
amzn-s3-demo-bucket
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [DeletePublicAccessBlock](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Set-S3BucketEncryption`
<a name="s3_PutBucketEncryption_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 버킷에서 Amazon S3 관리형 키(SSE-S3)를 사용하여 기본 AES256 서버 측 암호화를 활성화합니다.**  

```
$Encryptionconfig = @{ServerSideEncryptionByDefault = @{ServerSideEncryptionAlgorithm = "AES256"}}
Set-S3BucketEncryption -BucketName 'amzn-s3-demo-bucket' -ServerSideEncryptionConfiguration_ServerSideEncryptionRule $Encryptionconfig
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutBucketEncryption](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Test-S3Bucket`
<a name="s3_Test-S3Bucket_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1:이 명령에서는 버킷이 있는 경우 True를 반환하고, 그렇지 않으면 False를 반환합니다. 버킷이 사용자에게 속하지 않더라도 명령은 True를 반환합니다.**  

```
Test-S3Bucket -BucketName amzn-s3-demo-bucket
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [Test-S3Bucket](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Write-S3BucketAccelerateConfiguration`
<a name="s3_PutBucketAccelerateConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷의 전송 가속화를 활성화합니다.**  

```
$statusVal = New-Object Amazon.S3.BucketAccelerateStatus('Enabled')
Write-S3BucketAccelerateConfiguration -BucketName 'amzn-s3-demo-bucket' -AccelerateConfiguration_Status $statusVal
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutBucketAccelerateConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Write-S3BucketNotification`
<a name="s3_PutBucketNotification_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 예시는 S3 이벤트 ObjectRemovedDelete에 대한 SNS 주제를 구성하고 지정된 S3 버킷에 대한 알림을 활성화합니다.**  

```
$topic =  [Amazon.S3.Model.TopicConfiguration] @{
  Id = "delete-event"
  Topic = "arn:aws:sns:eu-west-1:123456789012:topic-1"
  Event = [Amazon.S3.EventType]::ObjectRemovedDelete
}

Write-S3BucketNotification -BucketName amzn-s3-demo-bucket -TopicConfiguration $topic
```
**예시 2: 이 예시는 지정된 버킷에 대해 ObjectCreatedAll 알림을 활성화하여 Lambda 함수로 전송합니다.**  

```
$lambdaConfig = [Amazon.S3.Model.LambdaFunctionConfiguration] @{
  Events = "s3:ObjectCreated:*"
  FunctionArn = "arn:aws:lambda:eu-west-1:123456789012:function:rdplock"
  Id = "ObjectCreated-Lambda"
  Filter = @{
    S3KeyFilter = @{
      FilterRules = @(
        @{Name="Prefix";Value="dada"}
        @{Name="Suffix";Value=".pem"}
      )
    }
  }
}

Write-S3BucketNotification -BucketName amzn-s3-demo-bucket -LambdaFunctionConfiguration $lambdaConfig
```
**예시 3: 이 예시는 서로 다른 키 접미사를 기반으로 2개의 서로 다른 Lambda 구성을 생성하고 단일 명령으로 둘 모두를 구성합니다.**  

```
#Lambda Config 1

$firstLambdaConfig = [Amazon.S3.Model.LambdaFunctionConfiguration] @{
  Events = "s3:ObjectCreated:*"
  FunctionArn = "arn:aws:lambda:eu-west-1:123456789012:function:verifynet"
  Id = "ObjectCreated-dada-ps1"
  Filter = @{
    S3KeyFilter = @{
      FilterRules = @(
        @{Name="Prefix";Value="dada"}
        @{Name="Suffix";Value=".ps1"}
      )
    }
  }
}

#Lambda Config 2

$secondlambdaConfig = [Amazon.S3.Model.LambdaFunctionConfiguration] @{
  Events = [Amazon.S3.EventType]::ObjectCreatedAll
  FunctionArn = "arn:aws:lambda:eu-west-1:123456789012:function:verifyssm"
  Id = "ObjectCreated-dada-json"
  Filter = @{
    S3KeyFilter = @{
      FilterRules = @(
        @{Name="Prefix";Value="dada"}
        @{Name="Suffix";Value=".json"}
      )
    }
  }
}

Write-S3BucketNotification -BucketName amzn-s3-demo-bucket -LambdaFunctionConfiguration $firstLambdaConfig,$secondlambdaConfig
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutBucketNotification](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Write-S3BucketReplication`
<a name="s3_PutBucketReplication_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 'amzn-s3-demo-bucket' 버킷에서 키 이름 접두사 'TaxDocs'로 생성된 모든 새 객체를 'amzn-s3-demo-bucket' 버킷에 복제할 수 있도록 하는 단일 규칙을 사용하여 복제 구성을 설정합니다.**  

```
$rule1 = New-Object Amazon.S3.Model.ReplicationRule
$rule1.ID = "Rule-1"
$rule1.Status = "Enabled"
$rule1.Prefix = "TaxDocs"
$rule1.Destination = @{ BucketArn = "arn:aws:s3:::amzn-s3-demo-destination-bucket" }
    
$params = @{
    BucketName = "amzn-s3-demo-bucket"
    Configuration_Role = "arn:aws:iam::35667example:role/CrossRegionReplicationRoleForS3"
    Configuration_Rule = $rule1
}

Write-S3BucketReplication @params
```
**예제 2: 이 예제에서는 키 이름 접두사 'TaxDocs' 또는 'OtherDocs'로 생성된 모든 새 객체를 'amzn-s3-demo-bucket' 버킷에 복제할 수 있도록 하는 여러 규칙을 사용하여 복제 구성을 설정합니다. 키 접두사는 겹치지 않아야 합니다.**  

```
$rule1 = New-Object Amazon.S3.Model.ReplicationRule
$rule1.ID = "Rule-1"
$rule1.Status = "Enabled"
$rule1.Prefix = "TaxDocs"
$rule1.Destination = @{ BucketArn = "arn:aws:s3:::amzn-s3-demo-destination-bucket" }
    
$rule2 = New-Object Amazon.S3.Model.ReplicationRule
$rule2.ID = "Rule-2"
$rule2.Status = "Enabled"
$rule2.Prefix = "OtherDocs"
$rule2.Destination = @{ BucketArn = "arn:aws:s3:::amzn-s3-demo-destination-bucket" }
    
$params = @{
    BucketName = "amzn-s3-demo-bucket"
    Configuration_Role = "arn:aws:iam::35667example:role/CrossRegionReplicationRoleForS3"
    Configuration_Rule = $rule1,$rule2
}

Write-S3BucketReplication @params
```
**예제 3: 이 예제에서는 지정된 버킷의 복제 구성을 업데이트하여 키 이름 접두사가 'TaxDocs'인 객체를 'amzn-s3-demo-bucket' 버킷으로 복제하는 작업을 제어하는 규칙을 비활성화합니다.**  

```
$rule1 = New-Object Amazon.S3.Model.ReplicationRule
$rule1.ID = "Rule-1"
$rule1.Status = "Disabled"
$rule1.Prefix = "TaxDocs"
$rule1.Destination = @{ BucketArn = "arn:aws:s3:::amzn-s3-demo-destination-bucket" }
    
$params = @{
    BucketName = "amzn-s3-demo-bucket"
    Configuration_Role = "arn:aws:iam::35667example:role/CrossRegionReplicationRoleForS3"
    Configuration_Rule = $rule1
}

Write-S3BucketReplication @params
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutBucketReplication](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Write-S3BucketRequestPayment`
<a name="s3_PutBucketRequestPayment_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이름이 'amzn-s3-demo-bucket'인 버킷의 요청 결제 구성을 업데이트하여 버킷에서 다운로드를 요청하는 사람에게 다운로드 요금이 부과되도록 합니다. 기본적으로 다운로드 비용은 버킷 소유자가 지불합니다. 지불 요청을 기본값으로 다시 설정하려면 RequestPaymentConfiguration\$1Payer 파라미터에 'BucketOwner'를 사용하세요.**  

```
Write-S3BucketRequestPayment -BucketName amzn-s3-demo-bucket -RequestPaymentConfiguration_Payer Requester
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutBucketRequestPayment](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Write-S3BucketTagging`
<a name="s3_PutBucketTagging_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 이름이 `cloudtrail-test-2018`인 버킷에 두 개의 태그를 적용합니다. 하나는 키가 Stage이고 값이 Test인 태그이며 다른 하나는 키가 Environment고 값이 Alpha인 태그입니다. 버킷에 태그가 추가되었는지 확인하려면 `Get-S3BucketTagging -BucketName bucket_name`을 실행합니다. 결과에는 첫 번째 명령에서 버킷에 적용한 태그가 표시되어야 합니다. 단, `Write-S3BucketTagging`은 버킷에 설정된 기존 태그 전체를 덮어씁니다. 개별 태그를 추가하거나 삭제하려면 리소스 그룹 및 태그 지정 API cmdlet, `Add-RGTResourceTag` 및 `Remove-RGTResourceTag`를 실행합니다. 또는 AWS Management Console에서 Tag Editor를 사용하여 S3 버킷 태그를 관리합니다.**  

```
Write-S3BucketTagging -BucketName amzn-s3-demo-bucket -TagSet @( @{ Key="Stage"; Value="Test" }, @{ Key="Environment"; Value="Alpha" } )
```
**예시 2: 이 명령은 이름이 `cloudtrail-test-2018`인 버킷을 `Write-S3BucketTagging` cmdlet으로 파이프합니다. 이렇게 하면 Stage:Production 및 Department:Finance 태그가 버킷에 적용됩니다. 단, `Write-S3BucketTagging`은 버킷에 설정된 기존 태그 전체를 덮어씁니다.**  

```
Get-S3Bucket -BucketName amzn-s3-demo-bucket | Write-S3BucketTagging -TagSet @( @{ Key="Stage"; Value="Production" }, @{ Key="Department"; Value="Finance" } )
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutBucketTagging](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Write-S3BucketVersioning`
<a name="s3_PutBucketVersioning_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷의 버전 관리를 활성화합니다.**  

```
Write-S3BucketVersioning -BucketName 'amzn-s3-demo-bucket' -VersioningConfig_Status Enabled
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutBucketVersioning](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Write-S3BucketWebsite`
<a name="s3_PutBucketWebsite_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 인덱스 문서가 'index.html', 오류 문서가 'error.html'인 지정된 버킷에 대한 웹 사이트 호스팅을 활성화합니다.**  

```
Write-S3BucketWebsite -BucketName 'amzn-s3-demo-bucket' -WebsiteConfiguration_IndexDocumentSuffix 'index.html' -WebsiteConfiguration_ErrorDocument 'error.html'
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutBucketWebsite](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Write-S3LifecycleConfiguration`
<a name="s3_PutLifecycleConfiguration_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예제 1: 이 예제에서는 \$1NewRule에 제공된 구성을 쓰거나 바꿉니다. 이 구성은 지정된 접두사 및 태그 값으로 범위 객체를 제한합니다.**  

```
$NewRule = [Amazon.S3.Model.LifecycleRule] @{
		Expiration =  @{
			Days=  50
		}
		Id =  "Test-From-Write-cmdlet-1"
		Filter=  @{
			LifecycleFilterPredicate =  [Amazon.S3.Model.LifecycleAndOperator]@{
				Operands=  @(
					[Amazon.S3.Model.LifecyclePrefixPredicate] @{
						"Prefix" =  "py"
					},
					[Amazon.S3.Model.LifecycleTagPredicate] @{
						"Tag"=  @{
							"Key" =  "non-use"
							"Value" = "yes"
						}
					}
				)
			}
		}
		"Status"= 'Enabled'
		NoncurrentVersionExpiration = @{
			NoncurrentDays = 75
		}
	}
    
	Write-S3LifecycleConfiguration -BucketName amzn-s3-demo-bucket -Configuration_Rule $NewRule
```
**예제 2: 이 예제에서는 필터링을 사용하여 여러 규칙을 설정합니다. \$1ArchiveRule은 객체가 30일 후에는 Glacier로, 120일 후에는 DeepArchive로 아카이브되도록 설정합니다. \$1ExpireRule은 'py' 접두사와 tag:key 'archieved'가 'yes'로 설정된 객체의 현재 버전과 이전 버전을 모두 150일 후에 만료시킵니다.**  

```
$ExpireRule = [Amazon.S3.Model.LifecycleRule] @{
		Expiration =  @{
			Days=  150
		}
		Id =  "Remove-in-150-days"
		Filter=  @{
			LifecycleFilterPredicate =  [Amazon.S3.Model.LifecycleAndOperator]@{
				Operands=  @(
					[Amazon.S3.Model.LifecyclePrefixPredicate] @{
						"Prefix" =  "py"
					},
					[Amazon.S3.Model.LifecycleTagPredicate] @{
						"Tag"=  @{
							"Key" =  "archived"
							"Value" = "yes"
						}
					}
				)
			}
		}
		Status= 'Enabled'
		NoncurrentVersionExpiration = @{
			NoncurrentDays = 150
		}
	}

	$ArchiveRule = [Amazon.S3.Model.LifecycleRule] @{
		Expiration =  $null
		Id =  "Archive-to-Glacier-in-30-days"
		Filter=  @{
			LifecycleFilterPredicate =  [Amazon.S3.Model.LifecycleAndOperator]@{
				Operands= @(
					[Amazon.S3.Model.LifecyclePrefixPredicate] @{
						"Prefix" =  "py"
					},
					[Amazon.S3.Model.LifecycleTagPredicate] @{
						"Tag"=  @{
							"Key" =  "reviewed"
							"Value" = "yes"
						}
					}
				)
			}
		}
		Status = 'Enabled'
		NoncurrentVersionExpiration = @{
			NoncurrentDays = 75
		}
		Transitions = @(
			@{
				Days = 30
				"StorageClass"= 'Glacier'
			},
			@{
				Days = 120
				"StorageClass"= [Amazon.S3.S3StorageClass]::DeepArchive
			}
		)
	}

	Write-S3LifecycleConfiguration -BucketName amzn-s3-demo-bucket -Configuration_Rule $ExpireRule,$ArchiveRule
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutLifecycleConfiguration](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.

### `Write-S3Object`
<a name="s3_PutObject_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 단일 파일 "local-sample.txt"를 Amazon S3에 업로드하고, "test-files" 버킷에 "sample.txt" 키가 있는 객체를 생성합니다.**  

```
Write-S3Object -BucketName amzn-s3-demo-bucket -Key "sample.txt" -File .\local-sample.txt
```
**예시 2: 이 명령은 단일 파일 "sample.txt"를 Amazon S3에 업로드하고, "test-files" 버킷에 "sample.txt" 키가 있는 객체를 생성합니다. -Key 파라미터가 제공되지 않은 경우 파일 이름이 S3 객체 키로 사용됩니다.**  

```
Write-S3Object -BucketName amzn-s3-demo-bucket -File .\sample.txt
```
**예시 3: 이 명령은 단일 파일 "local-sample.txt"를 Amazon S3에 업로드하고, "test-files" 버킷에 "prefix/to/sample.txt" 키가 있는 객체를 생성합니다.**  

```
Write-S3Object -BucketName amzn-s3-demo-bucket -Key "prefix/to/sample.txt" -File .\local-sample.txt
```
**예시 4: 이 명령은 하위 디렉터리 "Scripts"의 모든 파일을 "test-files" 버킷에 업로드하고 공통 키 접두사 "SampleScripts"를 각 객체에 적용합니다. 업로드된 각 파일에는 "SampleScripts/filename"이라는 키가 있으며, 여기서 'filename'은 상황에 따라 다릅니다.**  

```
Write-S3Object -BucketName amzn-s3-demo-bucket -Folder .\Scripts -KeyPrefix SampleScripts\
```
**예시 5: 이 명령은 로컬 디렉터리 "Scripts"의 모든 \$1.ps1 파일을 "test-files" 버킷에 업로드하고 공통 키 접두사 "SampleScripts"를 각 객체에 적용합니다. 업로드된 각 파일에는 "SampleScripts/filename.ps1"이라는 키가 있으며, 여기서 'filename'은 상황에 따라 다릅니다.**  

```
Write-S3Object -BucketName amzn-s3-demo-bucket -Folder .\Scripts -KeyPrefix SampleScripts\ -SearchPattern *.ps1
```
**예시 6: 이 명령은 키가 'sample.txt'인 지정된 콘텐츠 문자열을 포함하는 새 S3 객체를 생성합니다.**  

```
Write-S3Object -BucketName amzn-s3-demo-bucket -Key "sample.txt" -Content "object contents"
```
**예시 7: 이 명령은 지정된 파일(파일 이름이 키로 사용됨)을 업로드하고 지정된 태그를 새 객체에 적용합니다.**  

```
Write-S3Object -BucketName amzn-s3-demo-bucket -File "sample.txt" -TagSet @{Key="key1";Value="value1"},@{Key="key2";Value="value2"}
```
**예시 8: 이 명령은 지정된 폴더를 재귀적으로 업로드하고 지정된 태그를 모든 새 객체에 적용합니다.**  

```
Write-S3Object -BucketName amzn-s3-demo-bucket -Folder . -KeyPrefix "TaggedFiles" -Recurse -TagSet @{Key="key1";Value="value1"},@{Key="key2";Value="value2"}
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutObject](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

### `Write-S3ObjectRetention`
<a name="s3_PutObjectRetention_powershell_topic"></a>

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

**Tools for PowerShell V5**  
**예시 1: 이 명령은 지정된 S3 버킷의 'testfile.txt' 객체에 대해 '2019년 12월 31일 00:00:00' 날짜까지 거버넌스 보존 모드를 활성화합니다.**  

```
Write-S3ObjectRetention -BucketName 'amzn-s3-demo-bucket' -Key 'testfile.txt' -Retention_Mode GOVERNANCE -Retention_RetainUntilDate "2019-12-31T00:00:00"
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [PutObjectRetention](https://docs.aws.amazon.com/powershell/v5/reference)을 참조하세요.