AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Mounts a PowerShell drive backed by Amazon S3 so buckets, prefixes, and objects can be browsed with standard navigation commands. Maps to the whole account by default; use -Root to scope it to a bucket or prefix.

Syntax

Mount-S3PSDrive
-Name <String>
-Root <String>
-AWSCredential <AWSCredentials>
-StorageClass <S3StorageClass>
-PassThru <SwitchParameter>

Description

Mounts an S3 drive so buckets, prefixes, and objects can be explored with the standard navigation commands (Set-Location, Get-ChildItem, Get-Content, Set-Content, Remove-Item). By default, the drive maps to the whole account rather than a single bucket; use -Root to scope it to a bucket or prefix. Mounting does not change the current location. Use Get-PSDrive to list mounted drives and Set-Location to enter one. The drive is intended for navigation and ad hoc content work; for large local file transfers, use Read-S3Object and Write-S3Object. Credentials resolve the same way as the S3 cmdlets: explicit keys, then -ProfileName, then -AWSCredential, then the session default $StoredAWSCredentials, then the SDK default chain. Region follows the same order too: -Region, then $StoredAWSRegion, then the profile region, then the AWS_REGION environment variable, then EC2 instance metadata, then us-east-1. A single drive spans all regions. Thin wrapper over `New-PSDrive -PSProvider AWS.S3`, which also works directly.

Parameters

-AWSCredential <AWSCredentials>
A resolved AWSCredentials object. Named -AWSCredential (not -Credential, which New-PSDrive already defines as a PSCredential and would collide with).
Required?False
Position?Named
Accept pipeline input?False
-Name <String>
The drive name used in paths (e.g. -Name S3 -> paths look like S3:\bucket\key).
Required?False
Position?1
Accept pipeline input?False
-PassThru <SwitchParameter>
Return the created PSDriveInfo. By default the cmdlet produces no output.
Required?False
Position?Named
Accept pipeline input?False
-Root <String>
Scope the drive to a bucket ("my-bucket") or bucket+prefix ("my-bucket/data/2026") instead of the account root; navigation is then confined beneath it. Omitted mounts at the account root. The root must exist, or the mount fails.
Required?False
Position?Named
Accept pipeline input?False
-StorageClass <S3StorageClass>
Default storage class for objects uploaded to this drive (e.g. STANDARD_IA, GLACIER). When unset, S3 uses STANDARD. Overridable per upload via -StorageClass on Set-Content.
Required?False
Position?Named
Accept pipeline input?False

Common Credential and Region Parameters

-AccessKey <String>
Explicit AWS access key (use with -SecretKey).
Required?False
Position?Named
Accept pipeline input?False
-ProfileName <String>
Named AWS credential profile to authenticate with.
Required?False
Position?Named
Accept pipeline input?False
-Region <String>
AWS region for the mount. Falls back to $StoredAWSRegion, the profile region, the AWS_REGION environment variable, EC2 instance metadata, then us-east-1.
Required?False
Position?Named
Accept pipeline input?False
-SecretKey <String>
Explicit AWS secret key (use with -AccessKey).
Required?False
Position?Named
Accept pipeline input?False
-SessionToken <String>
Session token for temporary credentials (use with -AccessKey/-SecretKey).
Required?False
Position?Named
Accept pipeline input?False

Outputs

System.Management.Automation.PSDriveInfo
If -PassThru is specified, returns information about the mounted drive. Otherwise, this cmdlet does not generate any output.

Examples

Example 1

Mount-S3PSDrive -Name S3
Get-PSDrive -Name S3
Get-ChildItem -Path S3:\
Mounts an account-root S3 drive named S3 using the default credential and Region resolution. The cmdlet does not change the current location. Get-PSDrive shows the mounted drive, and Get-ChildItem lists the buckets available to the resolved credentials.

Example 2

Mount-S3PSDrive -Name ProjectData -Root 'amzn-s3-demo-bucket/projects/2026' -Region us-west-2
Set-Location ProjectData:\
Mounts a drive scoped to a bucket prefix and sets the Region used by the drive. Set-Location enters the drive explicitly because mounting does not change the current location.

Example 3

Mount-S3PSDrive -Name Archive -ProfileName my-profile -Region us-east-1
Mounts an account-root drive using credentials from a named profile.

Supported Version

AWS Tools for PowerShell: 2.x.y.z