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.
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 component 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. |
NewName | Rename the file specified by RemoteFile . |
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. |
Region | The region the component will make requests against. |
RemoteObject | The name of the remote object to rename. |
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. |
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:
MY | A certificate store holding personal certificates with their associated private keys. |
CA | Certifying authority certificates. |
ROOT | Root certificates. |
SPC | Software 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.). |
Machine | The certificate store is a machine store. |
PFXFile | The certificate store is the name of a PFX (PKCS12) file containing certificates. |
PFXBlob | The 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. |
PEMKeyFile | The certificate store is the name of a file that contains a PEM encoded certificate and private key. |
PEMKeyBlob | The certificate store is a string that contains a PEM encoded certificate and private key. |
P7BFile | The certificate store is the name of a file that contains P7B encoded certificates. |
SSHPublicKeyFile | The certificate store is the name of a file that contains an SSH-style public key. |
PPKFile | The certificate store is the name of a file that contains a PPK (PuTTY Private Key). |
PPKBlob | The 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). |
Tunnel | Connect through a tunneling proxy. FirewallPort is set to 80. |
SOCKS4 | Connect through a SOCKS4 Proxy. FirewallPort is set to 1080. |
SOCKS5 | Connect 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. |
Accept | Accepts the certificate without prompting the user, even if it is not trusted by default. |
Reject | Rejects 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.