Get-S3 Cmdlet
Parameters Output Objects Configuration Settings
The Get-S3 cmdlet provides an easy interface to Amazon's Simple Storage Service (S3).
Syntax
Get-S3 [parameters]
Remarks
The Get-S3 cmdlet allows you to access Amazon's Simple Storage Service (S3) in a secure manner using SSL. Get-S3 allows you to list objects and buckets, and download objects, all within powershell. A brief synopsis follows but please refer to Amazon S3 documentation for details.
You will first need to sign up for the S3 service and obtain an AccessKey and SecretKey from Amazon. Then you can start creating buckets in your account using Send-S3. The buckets are place holders for your objects allowing you to access them through http urls. You can then add objects to any of your buckets using Send-S3.
Get-S3 will allow you to retrieve information from your S3 account. For more information on how to upload and delete objects, or create and delete buckets please take a look at the Send-S3 cmdlet.
The cmdlets support pipeline input for some of their parameters. Prebuilding an object and piping it to the cmdlet is very useful, but should be used with caution to prevent security conflicts. Steps have been taken to decrease the risk of a possibly accidental pipe to the cmdlet, for instance, the Credential parameter cannot be piped to the cmdlet and must be specified manually.
#get bucket list
get
-s3 -AccessKey $S3AccessKey -SecretKey $S3SecretKey
#get object list in bucket
get
-s3 -AccessKey $S3AccessKey -SecretKey $S3SecretKey -bucket $bucket
#retrieve object
get
-s3 -AccessKey $S3AccessKey -SecretKey $S3SecretKey -bucket $bucket -RemoteObject $
object
#retrieve object and write to file
get
-s3 -AccessKey $S3AccessKey -SecretKey $S3SecretKey -bucket $bucket -RemoteObject $
object
-LocalFile tempobject.dat
Parameter List
The following is the full list of the parameters of the cmdlet with short descriptions. Click on the links for further details.
LogFile | The location of a file to which debug information is written. |
AccessKey | The Access Key Id for the Amazon Web Services account. |
Bucket | The name of the current bucket. |
CertPassword | The password to the certificate store. |
CertStore | The name of the certificate store for the client certificate. |
CertStoreType | The type of certificate store for the client certificate. |
CertSubject | The subject of the certificate used for client authentication. |
Config | Specifies one or more configuration settings. |
Credential | The PSCredential object to use for authentication. |
FirewallHost | Name or IP address of firewall. |
FirewallPassword | A password if authentication is to be used when connecting through the firewall. |
FirewallPort | The port of the firewall to which to connect. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
Force | Forces the cmdlet to accept the default behavior instead of querying the user. |
LocalFile | The local file to save the object data to. |
LocalIP | The IP address of the local interface to use. |
LogFile | The location of a file to which debug information is written. |
MaxObjects | The maximum number of objects to be returned. |
MetaOnly | Specifies whether only the headers should be returned from the server. |
ObjectPrefix | A prefix filter for listing objects. |
Overwrite | Specified whether the LocalFile should be overwritten. |
ProxyAutoDetect | Specifies if proxy information is automatically detected. |
ProxyPassword | The password to authenticate with. |
ProxyPort | The TCP port of the Proxy . |
ProxyServer | Name or IP address of a proxy server (optional). |
ProxyUser | The User value to authenticate with. |
RemoteObject | The name of the remote object to retrieve. |
SecretKey | The Secret Access Key for the Amazon Web Services account. |
SSL | Use SSL to access Amazon S3. |
SSLAccept | The encoded public key of the certificate which is to be trusted explicitly. |
Timeout | The maximum time allowed for the operation. |
UseVirtualHosting | Determines which style request to use. |
Output Objects
The following is the full list of the output objects returned by the cmdlet with short descriptions. Click on the links for further details.
Bucket | Returned for each bucket during a list bucket operation. |
S3Download | Returned when an object is retrieved from the S3 server. |
S3List | Fired for every object during a list object operation. |
S3MetaData | The headers returned from an S3 object when only the metadata is downloaded. |
Configuration Settings
The following is a list of configuration settings for the cmdlet with short descriptions. Click on the links for further details.
UseBackgroundThread | Whether threads created by the cmdlet are background threads. |
UseInternalSecurityAPI | Tells the cmdlet whether or not to use the system security libraries or an internal implementation. |