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

Uploads one or more files from the local file system to an Amazon Glacier vault.

Syntax

UploadSingleFile (Default)

Write-GLCArchive
-VaultName <String>
-AccountId <String>
-FilePath <String>
-Description <String>
-Force <SwitchParameter>

UploadFolder

Write-GLCArchive
-SearchPattern <String>
-VaultName <String>
-AccountId <String>
-FolderPath <String>
-Recurse <SwitchParameter>
-Force <SwitchParameter>

Description

Uploads a single file, or collection of files in a folder hierarchy, to a vault in Amazon Glacier. The cmdlet will automatically attempt to use multipart upload to fulfill the request depending on the size of each file being uploaded. If a multipart upload is interrupted the cmdlet will attempt to abort the multipart upload on your behalf. Under certain circumstances (network outage, power failure, etc.) the cmdlet may not be able to abort the multipart upload.

Parameters

-AccountId <String>
AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '-' (hyphen), in which case Amazon S3 Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, do not include any hyphens ('-') in the ID.If a value for this parameter is not specified the cmdlet will use a default value of '-'.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Description <String>
Optional description to apply to the uploaded archive.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-FilePath <String>
The full path to the local file to be uploaded.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-FolderPath <String>
The full path to a local folder. All files in the folder will be uploaded to the specified vault. Files contained in sub-folders of the specified folder will only be uploaded if the -Recurse switch is specified.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesDirectory
-Force <SwitchParameter>
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?False
-Recurse <SwitchParameter>
If set, all sub-folders beneath the folder specified in -Folder will also be uploaded. Defaults off [false].
Required?False
Position?Named
Accept pipeline input?False
-SearchPattern <String>
Optional search pattern to control which files in the specified folder path are uploaded to the vault. By default all files are processed.
Required?False
Position?5
Accept pipeline input?True (ByPropertyName)
AliasesPattern
-VaultName <String>
The name of the vault that will hold the uploaded content.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required? False
Position? Named
Accept pipeline input? False
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required? False
Position? Named
Accept pipeline input? False
-ProfileLocation <String>

Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)

If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials. Note that the encrypted credential file is not supported on all platforms. It will be skipped when searching for profiles on Windows Nano Server, Mac, and Linux platforms.

If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.

As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.

Required? False
Position? Named
Accept pipeline input? False
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required? False
Position? Named
Accept pipeline input? False
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required? False
Position? Named
Accept pipeline input? False
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required? False
Position? Named
Accept pipeline input? False
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required? False
Position? Named
Accept pipeline input? False
-Region <String>
The system name of the AWS region in which the operation should be invoked. For example, us-east-1, eu-west-1 etc.
Required? False
Position? Named
Accept pipeline input? False
-EndpointUrl <String>

The endpoint to make the call against.

Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.

Required? False
Position? Named
Accept pipeline input? False

Inputs

You can pipe a String object to this cmdlet for the FilePath parameter.

Outputs

Amazon.PowerShell.Cmdlets.GLC.FileUploadResult
The cmdlet returns one or more FileUploadResult instances specifying the source file path, archive ID (needed for later retrieval) and checksum of the uploaded artifact.

Examples

Example 1

PS C:\> Write-GLCArchive -VaultName myvault -FilePath c:\temp\blue.bin

FilePath ArchiveId Checksum
-------- --------- --------
C:\temp\blue.bin o9O9jUUs...TTX-TpIhQJw 79f3e...f4395b
Uploads a single file to the specified vault, returning the archive ID and computed checksum.

Example 2

PS C:\> Write-GLCArchive -VaultName myvault -FolderPath . -Recurse

FilePath ArchiveId Checksum
-------- --------- --------
C:\temp\blue.bin o9O9jUUs...TTX-TpIhQJw 79f3e...f4395b
C:\temp\green.bin qXAfOdSG...czo729UHXrw d50a1...9184b9
C:\temp\lum.bin 39aNifP3...q9nb8nZkFIg 28886...5c3e27
C:\temp\red.bin vp7E6rU_...Ejk_HhjAxKA e05f7...4e34f5
C:\temp\Folder1\file1.txt _eRINlip...5Sxy7dD2BaA d0d2a...c8a3ba
C:\temp\Folder2\file2.iso -Ix3jlmu...iXiDh-XfOPA 7469e...3e86f1
Uploads the contents of a folder hierarchy to the specified vault in the user's account. For each file uploaded the cmdlet emits the filename, corresponding archive ID and the computed checksum of the archive.

Supported Version

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