Rename-S3 Cmdlet

Parameters   Output Objects   Config Settings  

The Rename-S3 component is used to rename objects on Amazon S3 servers.

Syntax

Rename-S3 [parameters]

Remarks

The appropriate Amazon S3 credentials should be passed to the AccessKey, and SecretKey parameters. The Bucket parameter should be set to the bucket where the object resides. The object to rename is given by RemoteObject and the new name is given by NewName.

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.

# rename a file Rename-S3 -AccessKey $s3access -SecretKey $s3secret -Bucket myBucket -RemoteObject oldname.txt -NewName newname.txt

Parameter List


The following is the full list of the parameters of the cmdlet with short descriptions. Click on the links for further details.

LogFileThe location of a file to which debug information is written.
AccessKeyThe Access Key Id for the Amazon Web Services account.
BucketThe name of the current bucket.
CertPasswordThe password to the certificate store.
CertStoreThe name of the certificate store for the client certificate.
CertStoreTypeThe type of certificate store for the client certificate.
CertSubjectThe subject of the certificate used for client authentication.
ConfigSpecifies one or more configuration settings.
CredentialThe PSCredential object to use for authentication.
FirewallHostName or IP address of firewall.
FirewallPasswordA password if authentication is to be used when connecting through the firewall.
FirewallPortThe port of the firewall to which to connect.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
ForceForces the component to accept the default behavior instead of querying the user.
LocalFileThe local file to save the object data to.
LocalIPThe IP address of the local interface to use.
LogFileThe location of a file to which debug information is written.
NewNameRename the file specified by RemoteFile .
ProxyAutoDetectSpecifies if proxy information is automatically detected.
ProxyPasswordThe password to authenticate with.
ProxyPortThe TCP port of the Proxy .
ProxyServerName or IP address of a proxy server (optional).
ProxyUserThe User value to authenticate with.
RegionThe region the component will make requests against.
RemoteObjectThe name of the remote object to rename.
SecretKeyThe Secret Access Key for the Amazon Web Services account.
SSLUse SSL to access Amazon S3.
SSLAcceptThe encoded public key of the certificate which is to be trusted explicitly.
TimeoutThe maximum time allowed for the operation.
UseVirtualHostingDetermines 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.

BucketReturned for each bucket during a list bucket operation.

Config Settings


The following is a list of config settings for the cmdlet with short descriptions. Click on the links for further details.

LogFile Parameter (Rename-S3 Cmdlet)

The location of a file to which debug information is written.

Syntax

Rename-S3 -LogFile string

Remarks

When specified, the cmdlet will log debug information to the file. If the file exists, the information will be appended.

Default Value

null

AccessKey Property (Rename-S3 Cmdlet)

The Access Key Id for the Amazon Web Services account.

Syntax

Rename-S3 -AccessKey string

Remarks

For more information, please refer to the Amazon documentation.

Default Value

""

Bucket Property (Rename-S3 Cmdlet)

The name of the current bucket.

Syntax

Rename-S3 -Bucket string

Remarks

The Bucket parameter determines which bucket the cmdlet performs actions on. To get a list of buckets, leave this parameter empty when using the Get-S3 cmdlet.

Default Value

""

Parameter Alias

ListObjects

CertPassword Property (Rename-S3 Cmdlet)

The password to the certificate store.

Syntax

Rename-S3 -CertPassword string

Remarks

Specifies a password (if required) to access the specified certificate store.

Default Value

""

Parameter Alias

CertificatePassword

CertStore Property (Rename-S3 Cmdlet)

The name of the certificate store for the client certificate.

Syntax

Rename-S3 -CertStore string

Remarks

The CertStoreType parameter specifies the type of the certificate store specified by CertStore. If the store is password protected, specify the password in CertPassword.

CertStore is used in conjunction with the CertSubject parameter in order to specify client certificates. If CertStore has a value, and CertSubject has been set, a search for a certificate is initiated during logon. Please refer to the CertSubject parameter for details.

Designations of certificate stores are platform-dependent.

The following are designations of the most common User and Machine certificate stores in Windows:

MYA certificate store holding personal certificates with their associated private keys.
CACertifying authority certificates.
ROOTRoot certificates.
SPCSoftware publisher certificates.

When the certificate store type is PFXFile, this parameter must be set to the name of the file.

Default Value

"MY"

Parameter Alias

CertificateStore

CertStoreType Property (Rename-S3 Cmdlet)

The type of certificate store for the client certificate.

Syntax

Rename-S3 -CertStoreType string

Remarks

This parameter can take one of the following values:

User (default)This specifies that the certificate store is owned by the current user (these are the user's registry certificate stores such as MY, CA, etc.).
MachineThe certificate store is a machine store.
PFXFileThe certificate store is the name of a PFX (PKCS12) file containing certificates.
PFXBlobThe certificate store is a string (base64 encoded) representing a certificate store in PFX (PKCS12) format. You should use this option if storing a pfx file's content in a shell variable.
PEMKeyFileThe certificate store is the name of a file that contains a PEM encoded certificate and private key.
PEMKeyBlobThe certificate store is a string that contains a PEM encoded certificate and private key.
P7BFileThe certificate store is the name of a file that contains P7B encoded certificates.
SSHPublicKeyFileThe certificate store is the name of a file that contains an SSH-style public key.
PPKFileThe certificate store is the name of a file that contains a PPK (PuTTY Private Key).
PPKBlobThe certificate store is a string (binary) that contains a PPK (PuTTY Private Key).

Default Value

0

CertSubject Property (Rename-S3 Cmdlet)

The subject of the certificate used for client authentication.

Syntax

Rename-S3 -CertSubject string

Remarks

During the user authentication phase of the logon process, the cmdlet will search the store specified in CertStore for a certificate that matches this parameter. If the store contains a private key for that certificate, it is used to verify the user's identity with the secure server.

When this parameter is set, a search is performed in the current certificate store certificate with matching subject.

If an exact match is not found, the store is searched for subjects containing the value of the parameter.

When setting the parameter to a partial subject, CN= should be omitted. For example, the following code would find the certificate with subject CN=Test Certificate, OU=People, C=US

Example (Searching with partial subject)

-certsubject "Test"

If a match is not found, the parameter is set to an empty string, and no certificate is selected.

The special value "*" picks a random certificate in the certificate store.

Default Value

"*"

Config Property (Rename-S3 Cmdlet)

Specifies one or more configuration settings.

Syntax

Rename-S3 -Config string[]

Remarks

The Config parameter takes one or more name-value pairs that represent the name of the configuration setting and value, i.e.: -config "Name=Value"

Default Value

null

Credential Property (Rename-S3 Cmdlet)

The PSCredential object to use for authentication.

Syntax

Rename-S3 -Credential PSCredential

Remarks

In the case of S3 cmdlets, the User field contains the AccessKey and Password contains SecretKey.

Default Value

null

Parameter Alias

auth

FirewallHost Property (Rename-S3 Cmdlet)

Name or IP address of firewall.

Syntax

Rename-S3 -FirewallHost string

Remarks

If a FirewallHost is given, requested connections will be authenticated through the specified firewall when connecting.

If the FirewallHost parameter is set to a Domain Name, a DNS request is initiated. Upon successful termination of the request, the FirewallHost parameter is set to the corresponding address. If the search is not successful, an error is returned.

Default Value

""

FirewallPassword Property (Rename-S3 Cmdlet)

A password if authentication is to be used when connecting through the firewall.

Syntax

Rename-S3 -FirewallPassword string

Remarks

If FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to authenticate against the firewall.

Default Value

""

FirewallPort Property (Rename-S3 Cmdlet)

The port of the firewall to which to connect.

Syntax

Rename-S3 -FirewallPort int

Remarks

The TCP port for the FirewallHost. See the description of the FirewallHost parameter for details.

Note that the FirewallPort is set automatically when FirewallType is set to a valid value. See the description of the FirewallType parameter for details. Setting this parameter will overwrite the default settings for the firewall port as specified by FirewallType.

Default Value

0

FirewallType Property (Rename-S3 Cmdlet)

Determines the type of firewall to connect through.

Syntax

Rename-S3 -FirewallType string

Remarks

The applicable values are the following:

None No firewall (default setting).
TunnelConnect through a tunneling proxy. FirewallPort is set to 80.
SOCKS4Connect through a SOCKS4 Proxy. FirewallPort is set to 1080.
SOCKS5Connect through a SOCKS5 Proxy. FirewallPort is set to 1080.

Default Value

0

FirewallUser Property (Rename-S3 Cmdlet)

A user name if authentication is to be used connecting through a firewall.

Syntax

Rename-S3 -FirewallUser string

Remarks

If FirewallHost is specified, the FirewallUser and FirewallPassword properties are used to authenticate against the firewall.

Default Value

""

Force Property (Rename-S3 Cmdlet)

Forces the component to accept the default behavior instead of querying the user.

Syntax

Rename-S3 -Force SwitchParameter

Remarks

The Force parameter is especially useful in a script environment where user interaction is not an option. Certain cmdlets that are SSH and SSL based will query the user if the security credentials of the certificate presented by the server are not met. Setting this parameter will force the cmdlet to accept the certificate of the server unconditionally.

Default Value

false

LocalFile Property (Rename-S3 Cmdlet)

The local file to save the object data to.

Syntax

Rename-S3 -LocalFile string

Remarks

LocalFile contains the filename on the local machine where the object data is saved. If set, the S3Download's Value field will contain the full path to the file. If not set, S3Download's Value field contains the value of the object retrieved.

Default Value

""

LocalIP Property (Rename-S3 Cmdlet)

The IP address of the local interface to use.

Syntax

Rename-S3 -LocalIP string

Remarks

This parameter is useful when the cmdlet is running on a machine that has more than one network interface (each with its own IP address and network access privileges).

Default Value

""

Parameter Alias

LocalAddress

LogFile Property (Rename-S3 Cmdlet)

The location of a file to which debug information is written.

Syntax

Rename-S3 -LogFile string

Remarks

When specified, the cmdlet will log debug information to the file. If the file exists, the information will be appended.

Default Value

""

NewName Property (Rename-S3 Cmdlet)

Rename the file specified by RemoteFile .

Syntax

Rename-S3 -NewName string

Remarks

The NewName parameter specifies the new file name for RemoteFile.

Default Value

""

Parameter Position

2

This is a required parameter.

ProxyAutoDetect Property (Rename-S3 Cmdlet)

Specifies if proxy information is automatically detected.

Syntax

Rename-S3 -ProxyAutoDetect SwitchParameter

Remarks

This parameter tells the cmdlet whether or not to automatically detect and use proxy system settings, if available. The default value is False.

Default Value

false

ProxyPassword Property (Rename-S3 Cmdlet)

The password to authenticate with.

Syntax

Rename-S3 -ProxyPassword string

Remarks

If authentication is required with the proxy server, the ProxyPassword parameter specifies the password.

Default Value

""

ProxyPort Property (Rename-S3 Cmdlet)

The TCP port of the Proxy .

Syntax

Rename-S3 -ProxyPort int

Remarks

By default this value is set to 80.

Default Value

80

ProxyServer Property (Rename-S3 Cmdlet)

Name or IP address of a proxy server (optional).

Syntax

Rename-S3 -ProxyServer string

Remarks

If a Proxy is given, then the HTTP request is sent to the proxy instead of the server specified in the URL.

If the Proxy parameter is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, the Proxy parameter is set to the corresponding address. If the search is not successful, an error is returned.

Default Value

""

Parameter Alias

Proxy

ProxyUser Property (Rename-S3 Cmdlet)

The User value to authenticate with.

Syntax

Rename-S3 -ProxyUser string

Remarks

If authentication is required with the proxy server, the ProxyUser parameter specifies the username.

Default Value

""

Region Property (Rename-S3 Cmdlet)

The region the component will make requests against.

Syntax

Rename-S3 -Region string

Remarks

This property control which region the cmdlet will make requests against. By default the cmdlet uses us-east-1, the US East (N. Virginia) region. This property should be changed to create or access resources in other regions.

Regions:

Value Region
us-east-1 (Default) US East (N. Virginia)
us-east-2 US East (Ohio)
us-west-1 US West (N. California)
us-west-2 US West (Oregon)
ap-east-1 Asia Pacific (Hong Kong)
ap-northeast-1 Asia Pacific (Tokyo)
ap-northeast-2 Asia Pacific (Seoul)
ap-northeast-3 Asia Pacific (Osaka-Local)
ap-south-1 Asia Pacific (Mumbai)
ap-southeast-1 Asia Pacific (Singapore)
ap-southeast-2 Asia Pacific (Sydney)
ca-central-1 Canada (Central)
cn-north-1 China (Beijing)
cn-northwest-1 China (Ningxia)
eu-central-1 Europe (Frankfurt)
eu-north-1 Europe (Stockholm)
eu-south-1 Europe (Milan)
eu-west-1 Europe (Ireland)
eu-west-2 Europe (London)
eu-west-3 Europe (Paris)
me-south-1 Middle East (Bahrain)
sa-east-1 South America (Sao Paulo)

The cmdlet will always convert this property's value to lowercase. If this property is cleared, the cmdlet will reset it to the default value.

Default Value

"us-east-1"

RemoteObject Property (Rename-S3 Cmdlet)

The name of the remote object to rename.

Syntax

Rename-S3 -RemoteObject string

Remarks

Setting this flag will trigger the cmdlet to retrieve the specified object located in Bucket.

Default Value

""

Parameter Position

1

Parameter Alias

Object

This is a required parameter.

SecretKey Property (Rename-S3 Cmdlet)

The Secret Access Key for the Amazon Web Services account.

Syntax

Rename-S3 -SecretKey string

Remarks

For more information, please refer to the Amazon documentation.

Default Value

""

SSL Property (Rename-S3 Cmdlet)

Use SSL to access Amazon S3.

Syntax

Rename-S3 -SSL SwitchParameter

Remarks

Use this property to determine whether the cmdlet uses SSL to connect with Amazon S3 servers.

Default Value

true

SSLAccept Property (Rename-S3 Cmdlet)

The encoded public key of the certificate which is to be trusted explicitly.

Syntax

Rename-S3 -SSLAccept string

Remarks

Ordinarily, the certificate presented by the server will be checked against the system certificate stores to see if the Certificate Authority is trusted, and if not, the cmdlet will prompt the user to accept the certificate. Setting this parameter will override the system settings and trust the certificate provided.

After each connection, regardless of whether or not the certificate was trusted, the cmdlet will store the certificate presented by the server in the $SSLServerCertificate session variable. This variable can be inspected to view details of the server's certificate.

If the Force parameter is set, the cmdlet will accept the server's certificate unconditionally.

In cases where the certificate presented by the server is not trusted, a prompt will be shown to the user. This prompt will allow the user to decide whether or not they would like to accept the certificate presented by the server.

There may be cases where you do not want a prompt to be displayed or would like to handle the response supplied directly within your script. This can be done by setting the $SSLAcceptPreference variable prior to running the cmdlet. The available values for this variable are:

None (default)Maintains the default behavior. If the certificate is not trusted by default, the user will be prompted.
AcceptAccepts the certificate without prompting the user, even if it is not trusted by default.
RejectRejects the certificate without prompting the user only if it is not trusted by default. Thus if the certificate is found to be trusted or the Force parameter is set, the connection will still be accepted.

Default Value

""

Parameter Alias

Accept

Timeout Property (Rename-S3 Cmdlet)

The maximum time allowed for the operation.

Syntax

Rename-S3 -Timeout int

Remarks

After the specified interval in seconds, the cmdlet will throw a Timeout error if the operation is not completed.

Default Value

10

UseVirtualHosting Property (Rename-S3 Cmdlet)

Determines which style request to use.

Syntax

Rename-S3 -UseVirtualHosting SwitchParameter

Remarks

If set to true (default), buckets will be referenced in the request using the hosted-style request: http://yourbucket.s3.amazonaws.com/yourobject If false, the cmdlet will use the path-style request: http://s3.amazonaws.com/yourbucket/yourobject

NOTE: When set to true, there are more limitations when choosing a bucket name due to DNS server naming restrictions. See Amazon's documentation for more detailed naming information.

Default Value

true

Bucket Output Object (Rename-S3 Cmdlet)

Returned for each bucket during a list bucket operation.

Syntax

Object Bucket {
   string Name;
   string CreationDate;
   string OwnerId;
   string OwnerName;
   string OtherData;
}

Remarks

This object is returned for each bucket when a list bucket operation is triggered. It allows you to inspect properties of a bucket like its name, creation date, owner id and owner name. "Other Data" is reserved for future use.

Config Settings (Rename-S3 Cmdlet)